-
Notifications
You must be signed in to change notification settings - Fork 28
112 lines (93 loc) · 2.84 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# workflow pipeline
name: Test
on: ["push", "pull_request"]
jobs:
hardhat-test:
runs-on: ubuntu-latest
env:
AVAX_API: https://api.avax.network/ext/bc/C/rpc
ALCHEMY_API: ${{ secrets.ALCHEMY_API }}
DD_ENV: ci
steps:
- name: Datadog Agent
uses: DataDog/agent-github-action@v1
with:
api_key: ${{ secrets.DD_API_KEY }}
- uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
submodules: recursive
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Install and Compile
run: |
npm ci
npm run build
- name: Test
run: |
npm run test
foundry-base:
runs-on: ubuntu-latest
env:
FOUNDRY_FUZZ_RUNS: 2000
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Installing dependencies
run: npm ci
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run tests
run: ./script/foundry-base.sh
foundry-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Installing dependencies
run: npm ci
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Build contracts
run: forge build
- name: Run integration tests
# The public RPC URLs are defined in .env.example
run: |
mv .env.example .env
./script/foundry-integration.sh