Skip to content

fix: Track historical TVL for Lighter pools via PnL endpoint #4646

fix: Track historical TVL for Lighter pools via PnL endpoint

fix: Track historical TVL for Lighter pools via PnL endpoint #4646

Workflow file for this run

name: Automated test suite
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test-python:
# Reserved multicore instance for running tests
runs-on:
group: Beefy runners
# Only run the action for the latest push
# See https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.python-version }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
name: Python ${{ matrix.python-version }}
steps:
# TODO: we only need contracts/aave-v3-deploy for tests
# but there does not seem to be an option to choose which submodules to checkout
# https://github.com/actions/checkout
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Node.js
uses: actions/setup-node@v3
with:
# npm version need to support aave-deploy
node-version: 18
cache: "npm"
cache-dependency-path: contracts/aave-v3-deploy/package-lock.json
# # pnpm needed to compile Enzyme
# # We need version 7 to be exact.
# - name: Install pnpm
# run: |
# curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=7.27.1 sh -
# PNPM_HOME="/home/runner/.local/share/pnpm"
# # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
# echo $PNPM_HOME >> $GITHUB_PATH
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.21.0
- name: Export PNPM location
run: |
PNPM_HOME="/home/runner/.local/share/pnpm"
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
echo $PNPM_HOME >> $GITHUB_PATH
- name: Install poetry (using matrix Python)
run: pipx install "poetry>=2.3" --python "${{ env.PYTHON_PATH }}"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
cache-dependency-path: |
**/pyproject.toml
- name: Install dependencies
run: |
poetry install
poetry install -E docs -E data -E test -E hypersync -E ccxt -E duckdb
- name: Install Ganache
run: yarn global add ganache
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
# pick a nightly release from: https://github.com/foundry-rs/foundry/releases
# version: "nightly-de33b6af53005037b463318d2628b5cfcaf39916"
#version: "nightly-fdd321bac95f0935529164a88faf99d4d5cfa321"
version: "v1.2.3"
# We also work around race condition for setting up Aave NPM packages.
- name: Setup Aave v3 for tests
run: |
poetry run install-aave-for-testing
# We also work around race condition for setting up Aave NPM packages.
- name: Build needed contracts
run: |
pnpm --version
# Broken with the latest foudry?
# make guard in-house safe-integration
# Lagoon source deployment needs soldeer
- name: Lagoon dependency issue smoke test
run: |
export PATH="$HOME/.cargo/bin:$PATH"
(cd contracts/lagoon-v0 && forge soldeer install)
ls -lha contracts/lagoon-v0/dependencies/
ls -lha contracts/lagoon-v0/dependencies/@openzeppelin-contracts-upgradeable-5.0.0/
# CRITICAL: Verify the correct Web3.py version is installed
# This helps debug any remaining issues
- name: Verify Web3.py version and environment isolation
run: |
echo "=== Environment Information ==="
poetry env info
echo ""
echo "=== Python Version ==="
poetry run python --version
echo ""
echo "=== Web3.py Version ==="
poetry run python -c "import web3; print(f'Web3.py version: {web3.__version__}')"
echo ""
echo "=== Installed Packages (Web3-related) ==="
poetry run python -c "
import pkg_resources
web3_packages = [pkg for pkg in pkg_resources.working_set if 'web3' in pkg.project_name.lower() or 'eth' in pkg.project_name.lower()]
for pkg in sorted(web3_packages, key=lambda x: x.project_name):
print(f'{pkg.project_name}: {pkg.version}')
"
# Setup Debug Session before tests - Enable this when you need to debug test issues
# - name: Setup Debug Session Before Tests
# uses: csexton/debugger-action@master
# - name: Setup tmate session for debugging
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
# if: ${{ failure() || github.event.inputs.debug == 'true' }}
- name: Run tests (parallel)
run: |
# NOTE: GMX tests are excluded here and run separately in test-gmx.yml workflow
# GMX tests cannot run in parallel due to mainnet fork state conflicts
# See .github/workflows/test-gmx.yml for details on why parallel execution fails
#
# Enable verbose output if debugging is enabled
if [ "$ENABLE_VERBOSE_LOGGING" = "true" ]; then
poetry run pytest --timeout-method=thread --tb=native -n auto -v -s --capture=no --ignore=tests/gmx
else
poetry run pytest --timeout-method=thread --tb=native -n auto --ignore=tests/gmx
fi
env:
BNB_CHAIN_JSON_RPC: ${{ secrets.BNB_CHAIN_JSON_RPC }}
JSON_RPC_POLYGON_ARCHIVE: ${{ secrets.JSON_RPC_POLYGON_ARCHIVE }}
JSON_RPC_POLYGON: ${{ secrets.JSON_RPC_POLYGON }}
JSON_RPC_ETHEREUM: ${{ secrets.JSON_RPC_ETHEREUM }}
JSON_RPC_BASE: ${{ secrets.JSON_RPC_BASE }}
JSON_RPC_BINANCE: ${{ secrets.JSON_RPC_BINANCE }}
JSON_RPC_ARBITRUM: ${{ secrets.JSON_RPC_ARBITRUM }}
JSON_RPC_PLASMA: ${{ secrets.JSON_RPC_PLASMA }}
JSON_RPC_HYPERLIQUID: ${{ secrets.JSON_RPC_HYPERLIQUID }}
ETHEREUM_JSON_RPC: ${{ secrets.JSON_RPC_ETHEREUM }}
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
GOOGLE_CLOUD_REGION: ${{ secrets.GOOGLE_CLOUD_REGION }}
KEY_RING: ${{ secrets.KEY_RING }}
KEY_NAME: ${{ secrets.KEY_NAME }}
GCP_ADC_CREDENTIALS_STRING: ${{ secrets.GCP_ADC_CREDENTIALS_STRING }}
TOKEN_RISK_API_KEY: ${{ secrets.TOKEN_RISK_API_KEY }}
ARBITRUM_SEPOLIA_RPC_URL: ${{ secrets.ARBITRUM_SEPOLIA_RPC_URL }}
ARBITRUM_GMX_TEST_SEPOLIA_PRIVATE_KEY: ${{ secrets.ARBITRUM_GMX_TEST_SEPOLIA_PRIVATE_KEY }}
HYPERSYNC_API_KEY: ${{ secrets.HYPERSYNC_API_KEY }}
- name: Ruff lint check
run: |
poetry run ruff format --check --diff