Skip to content

fix: lab view URL

fix: lab view URL #50

Workflow file for this run

# These tests are separated into a separate file to be able to use secrets when running in a fork.
# To avoid leaking secrets, we only allow contributors to run the tests.
# Note that pull_request_trigger runs from the base branch, not the head branch.
# So, we need to manually check out the head ref and merge the base branch into it.
name: integration
on:
pull_request_target:
push:
branches:
- master
jobs:
integration:
name: "integration tests (Alchemy: fork mode and Sepolia)"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
# given we use the pull_request_trigger, only allow contributors to run tests with secrets
- 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');
}
# this will check out the base branch, not the head branch
- uses: actions/checkout@v4
with:
fetch-depth: 0 # we need the history to be able to merge
# now merge the head branch into the base branch, so we can run the tests with the head branch's changes
- name: Merge head branch
run: |
git fetch origin ${{ github.head_ref }}
git merge origin/${{ github.head_ref }} --no-edit
- 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 }}