-
Notifications
You must be signed in to change notification settings - Fork 22
76 lines (64 loc) · 2.21 KB
/
action.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
#poetry github actions from : https://jacobian.org/til/github-actions-poetry/
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14'
- uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- run: npm install -g ganache-cli
- uses: actions/setup-python@v2
with:
python-version: 3.11
- uses: actions/checkout@v3
- name: Checkout submodules
shell: bash
run: |
git submodule update --recursive --init --remote
- name: cache poetry install
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-1.3.1-0
- uses: snok/install-poetry@v1
with:
version: 1.3.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: cache deps
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- run: poetry install --no-interaction
- run: touch .env
- name: run test
shell: bash
env:
ETHERSCAN_TOKEN: ${{secrets.ETHERSCAN_TOKEN}}
WEB3_INFURA_PROJECT_ID: ${{secrets.WEB3_INFURA_PROJECT_ID}}
run: |
poetry run brownie networks add development goerli-fork-dev cmd=ganache-cli host=http://127.0.0.1 chain_id=5 fork="https://goerli.infura.io/v3/$WEB3_INFURA_PROJECT_ID" accounts=10 mnemonic=brownie port=8545
poetry run brownie networks modify goerli-fork-dev explorer="https://api-goerli.etherscan.io/api?apikey=$ETHERSCAN_TOKEN"
poetry run brownie test --network goerli-fork-dev
flake8-lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: flake8 Lint
uses: py-actions/flake8@v2