-
-
Notifications
You must be signed in to change notification settings - Fork 59
93 lines (75 loc) · 2.26 KB
/
test-contracts.yml
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
name: 🕵️♂️ Test smart contracts
on: [push, pull_request]
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
architecture:
- x64
python-version:
- 3.11
node_version:
- 18
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install Vyper
run: pip install vyper
- name: Check userdoc and devdoc compilation
run: python scripts/compile.py
- name: Setup Ape
uses: ApeWorX/github-action@v2
with:
python-version: ${{ matrix.python-version }}
- name: Check Ape compilation
run: ape compile
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore Yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: Install Yarn project with a clean slate
run: yarn install --prefer-offline --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Show the Foundry CI config
run: forge config
env:
FOUNDRY_PROFILE: ci
- name: Foundry tests
run: forge test
env:
FOUNDRY_PROFILE: ci
- name: Show the Foundry default config
run: forge config
env:
FOUNDRY_PROFILE: default
- name: Run snapshot
run: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY
env:
FOUNDRY_PROFILE: default