-
Notifications
You must be signed in to change notification settings - Fork 50
112 lines (94 loc) · 3.19 KB
/
main.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
name: unitary
on:
pull_request_target:
push:
branches:
- master
jobs:
unitary:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10", "3.11" ]
name: "unit tests: python ${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install Requirements
run: |
pip install -r dev-requirements.txt
pip install .
- name: Run Unit Tests
env:
PYTHONPATH: ${{ github.workspace }}
# pass internals to pytest-cov, since we are testing a pytest plugin.
# See https://github.com/pytest-dev/pytest-cov/blob/2c9f2170/docs/plugins.rst
COV_CORE_SOURCE: boa
COV_CORE_CONFIG: .coveragerc
COV_CORE_DATAFILE: .coverage.eager
run: >-
pytest
--cov=boa
--cov-append
--cov-report term-missing:skip-covered
--cov-fail-under=70
tests/unitary/
anvil:
name: "integration tests (anvil)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install Requirements
run: |
pip install -r dev-requirements.txt
pip install .
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Run Networked Tests against anvil
# run separately to clarify its dependency on outside binary
run: pytest -n auto tests/integration/network/anvil/
integration:
name: "integration tests (Alchemy: fork mode and Sepolia)"
runs-on: ubuntu-latest
steps:
- name: Check if the user is a contributor
uses: actions/github-script@v7
with:
script: |
const { actor: username, repo: { owner, repo } } = context;
const collaborator = await github.rest.repos.getCollaboratorPermissionLevel({ owner, repo, username });
if (!collaborator.data.user.permissions.push) {
core.setFailed(username + ' is not a contributor');
}
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"
- name: Install Requirements
run: |
pip install -r dev-requirements.txt
pip install .
- name: Run Fork Mode Tests
run: pytest -n auto tests/integration/fork/
env:
MAINNET_ENDPOINT: ${{ secrets.ALCHEMY_MAINNET_ENDPOINT }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
- name: Run Sepolia Tests
# disable xdist, otherwise they can contend for tx nonce
run: pytest -n 0 tests/integration/network/sepolia/
env:
SEPOLIA_ENDPOINT: ${{ secrets.ALCHEMY_SEPOLIA_ENDPOINT }}
SEPOLIA_PKEY: ${{ secrets.SEPOLIA_PKEY }}