Skip to content

Commit 7333448

Browse files
committed
ci: added public PROVIDERs for PRs, experimenting with testing beyond mainnet
1 parent 14bb039 commit 7333448

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,33 @@ on:
66
pull_request:
77
branches: [ master ]
88

9+
env:
10+
# Public key for PRs, plz don't abuse
11+
PROVIDER_MAINNET: ${{ secrets.MAINNET_PROVIDER || 'https://mainnet.infura.io/v3/42ffb4f2549c4a5fa3b5d6db70f6fad1' }}
12+
PROVIDER_ARBITRUM: 'https://rpc.ankr.com/arbitrum'
13+
PROVIDER_XDAI: 'https://rpc.ankr.com/gnosis'
14+
915
jobs:
1016
test:
11-
name: test (v${{ matrix.uniswap-version }})
17+
name: test (v${{ matrix.uniswap-version }}, ${{ matrix.network }})
1218
runs-on: ubuntu-latest
1319
strategy:
1420
fail-fast: false
1521
matrix:
1622
uniswap-version: [1, 2, 3]
23+
network: ["mainnet"]
24+
include:
25+
- network: arbitrum
26+
uniswap-version: 3
27+
#include:
28+
# - network: xdai
29+
# uniswap-version: 3
30+
#include:
31+
# - network: optimism
32+
# uniswap-version: 3
33+
#include:
34+
# - network: polygon
35+
# uniswap-version: 3
1736

1837
steps:
1938
- uses: actions/checkout@v2
@@ -35,26 +54,31 @@ jobs:
3554
run: |
3655
python -m pip install --upgrade pip poetry
3756
poetry config virtualenvs.in-project true
57+
3858
- name: Set up cache
3959
uses: actions/cache@v2
4060
id: cache
4161
with:
4262
path: .venv
4363
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
64+
4465
- name: Ensure cache is healthy
4566
if: steps.cache.outputs.cache-hit == 'true'
4667
run: timeout 10s poetry run pip --version || rm -rf .venv
4768

4869
- name: Install dependencies
4970
run: |
5071
poetry install
51-
npm install -g ganache@7.0.1
72+
npm install -g ganache@7.3.2
73+
5274
- name: Test
5375
env:
54-
PROVIDER: ${{ secrets.MAINNET_PROVIDER }}
76+
# Use the secret if available, otherwise fallback to the public key
77+
PROVIDER: ${{ ((matrix.network == 'mainnet') && env.PROVIDER_MAINNET) || ((matrix.network == 'arbitrum') && env.PROVIDER_ARBITRUM) }}
5578
UNISWAP_VERSION: ${{ matrix.uniswap-version }}
5679
run: |
5780
make test
81+
5882
- name: "Upload coverage to Codecov"
5983
uses: codecov/codecov-action@v1
6084
with:
@@ -76,16 +100,19 @@ jobs:
76100
id: full-python-version
77101
run: |
78102
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info[:3]))")
103+
79104
- name: Set up poetry
80105
run: |
81106
python -m pip install --upgrade pip poetry
82107
poetry config virtualenvs.in-project true
108+
83109
- name: Set up cache
84110
uses: actions/cache@v2
85111
id: cache
86112
with:
87113
path: .venv
88114
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
115+
89116
- name: Ensure cache is healthy
90117
if: steps.cache.outputs.cache-hit == 'true'
91118
run: timeout 10s poetry run pip --version || rm -rf .venv
@@ -94,6 +121,7 @@ jobs:
94121
run: |
95122
python -m pip install --upgrade pip poetry
96123
poetry install
124+
97125
- name: Typecheck
98126
run: |
99127
make typecheck

0 commit comments

Comments
 (0)