feat: use semaphore for all_pools_for #2149
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PyTest | |
on: | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [ master, dev ] | |
paths: | |
- '**.py' | |
- '**/pytest.yaml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
#timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
pyversion: [ "3.8", "3.9", "3.10" ] | |
network: [ mainnet, bsc-main, polygon-main, ftm-main, arbitrum-main, optimism-main ] | |
include: | |
- os: ubuntu-latest | |
path: ~/.cache/pip | |
- os: macos-latest | |
path: ~/Library/Caches/pip | |
- os: windows-latest | |
path: ~\AppData\Local\pip\Cache | |
- network: mainnet | |
provider: WEB3_PROVIDER | |
- network: bsc-main | |
provider: BSC_WEB3_PROVIDER | |
- network: polygon-main | |
provider: POLY_WEB3_PROVIDER | |
- network: ftm-main | |
provider: FTM_WEB3_PROVIDER | |
- network: arbitrum-main | |
provider: ARBI_WEB3_PROVIDER | |
- network: optimism-main | |
provider: OPTI_WEB3_PROVIDER | |
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: ${{ matrix.pyversion }} | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-dev.txt') }} | |
path: | | |
${{ matrix.path }} | |
- name: Cache joblib middleware cache | |
uses: actions/cache@v3 | |
with: | |
# Include requirements.txt so we recache if web3 version changes | |
key: forceupdatedeletethislater3-${{ runner.os }}-${{ matrix.network }}-${{ hashFiles('**/middleware.py') }}-${{ hashFiles('**/requirements.txt') }} | |
path: | | |
./cache/*/joblib/web3/middleware/filter/middleware | |
- name: Install dependencies | |
run: | | |
pip install -r requirements-dev.txt | |
pip install -r requirements.txt | |
- name: Setup brownie networks | |
run: | | |
brownie networks modify ${{ matrix.network }} host=${{ secrets[matrix.provider] }} | |
continue-on-error: true | |
- name: Cache compilers and brownie deployments | |
uses: actions/cache@v3 | |
with: | |
key: forceupdatedeletethislater3-${{ runner.os }}-brownie-cache-${{ matrix.network }} | |
path: | | |
~/.brownie/deployments.db | |
~/.solcx | |
~/.vvm | |
- name: Run test suite | |
env: | |
BROWNIE_NETWORK: ${{ matrix.network }} | |
# Explorer tokens for all chains: | |
ETHERSCAN_TOKEN: ${{ secrets.ETHERSCAN_TOKEN }} | |
BSCSCAN_TOKEN: ${{ secrets.BSCSCAN_TOKEN }} | |
POLYGONSCAN_TOKEN: ${{ secrets.POLYGONSCAN_TOKEN }} | |
FTMSCAN_TOKEN: ${{ secrets.FTMSCAN_TOKEN }} | |
ARBISCAN_TOKEN: ${{ secrets.ARBISCAN_TOKEN }} | |
OPTISCAN_TOKEN: ${{ secrets.OPTISCAN_TOKEN }} | |
run: make test | |