forked from yearn/yearn-exporter
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (72 loc) · 2.66 KB
/
tests.prices.uniswap.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
name: Test Uniswap
on:
push:
branches-ignore:
- master
paths:
- '**/uniswap/v1.py'
- '**/uniswap/v2.py'
- '**/uniswap/v3.py'
- '**/test_uniswap.py'
- '**/tests.prices.uniswap.yaml'
jobs:
test_uniswap:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
network: [ mainnet, ftm-main ]
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-latest
path: ~/Library/Caches/pip
- os: windows-latest
path: ~\AppData\Local\pip\Cache
# Providers for all chains.
- network: mainnet
provider: WEB3_PROVIDER
- network: ftm-main
provider: FTM_WEB3_PROVIDER
fail-fast: false
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Setup Python (faster than using Python container)
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Cache dependencies
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ${{ matrix.path }}
- name: Cache joblib middleware cache
uses: actions/cache@v3
with:
# Include requirements.txt so we recache if web3 version changes (via brownie)
key: uniswap-${{ runner.os }}-${{ matrix.network }}-${{ hashFiles('**/middleware.py') }}-${{ hashFiles('**/requirements.txt') }}
path: ./cache/*/joblib/web3/middleware/filter/middleware
- name: Cache compilers and brownie deployments
uses: actions/cache@v3
with:
key: uniswap-${{ runner.os }}-brownie-cache-${{ matrix.network }}
path: |
~/.brownie/deployments.db
~/.solcx
~/.vvm
- name: Prep dependencies
run: pip install wheel && pip install "Cython<3.0" "pyyaml==5.4.1" --no-build-isolation
- name: Install dependencies
run: pip install -r requirements.txt
- name: Setup brownie networks
run: brownie networks modify ${{ matrix.network }} host=${{ secrets[matrix.provider] }}
# continue-on-error is needed because this step will raise an exception on Windows, but will still correctly set the host.
continue-on-error: true
- name: Test Uniswap
env:
PYTEST_NETWORK: ${{ matrix.network }}
# Explorer tokens for all chains:
ETHERSCAN_TOKEN: ${{ secrets.ETHERSCAN_TOKEN }}
FTMSCAN_TOKEN: ${{ secrets.FTMSCAN_TOKEN }}
run: pytest tests/prices/test_uniswap.py -W ignore