-
Notifications
You must be signed in to change notification settings - Fork 135
96 lines (82 loc) · 3.16 KB
/
test.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
94
95
96
name: Automated test suite
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test-python:
# Reserved multicore instance for running tests
runs-on:
group: Beefy runners
# Only run the action for the latest push
# See https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
# TODO: we only need contracts/aave-v3-deploy for tests
# but there does not seem to be an option to choose which submodules to checkout
# https://github.com/actions/checkout
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: contracts/aave-v3-deploy/package-lock.json
# pnpm needed to compile Enzyme
# We need version 7 to be exact.
- name: Install pnpm
run: |
curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=7.27.1 sh -
PNPM_HOME="/home/runner/.local/share/pnpm"
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
echo $PNPM_HOME >> $GITHUB_PATH
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.12'
cache: 'poetry'
- name: Install dependencies
run: |
poetry env use '3.12'
poetry install --all-extras
- name: Install Ganache
run: yarn global add ganache
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
# pick a nightly release from: https://github.com/foundry-rs/foundry/releases
# version: 'nightly-de33b6af53005037b463318d2628b5cfcaf39916'
version: "nightly-c63aba816b76f9bad103b1275cc662a063919403"
# We also work around race condition for setting up Aave NPM packages.
- name: Setup Aave v3 for tests
run: |
poetry run install-aave-for-testing
# We also work around race condition for setting up Aave NPM packages.
- name: Build needed contracts
run: |
pnpm --version
make guard in-house
# Run tests parallel.
- name: Run test scripts
run: |
poetry run pytest --tb=native -n auto
env:
BNB_CHAIN_JSON_RPC: ${{ secrets.BNB_CHAIN_JSON_RPC }}
JSON_RPC_POLYGON_ARCHIVE: ${{ secrets.JSON_RPC_POLYGON_ARCHIVE }}
JSON_RPC_POLYGON: ${{ secrets.JSON_RPC_POLYGON }}
JSON_RPC_ETHEREUM: ${{ secrets.JSON_RPC_ETHEREUM }}
JSON_RPC_BASE: ${{ secrets.JSON_RPC_BASE }}
ETHEREUM_JSON_RPC: ${{ secrets.JSON_RPC_ETHEREUM }}
# Disabled for now
# https://github.com/reviewdog/action-flake8/issues/40
# - name: Run flake8
# uses: reviewdog/action-flake8@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}