test: adding unit tests for events #238
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: CI Workflow | |
on: [push] | |
jobs: | |
# Linting with Pre-commit | |
ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: astral-sh/ruff-action@v1 | |
- name: Set up Python 3.12.6 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12.6 | |
# Run pre-commit hooks (e.g., black, flake8, isort) | |
- uses: pre-commit/[email protected] | |
# Test runs | |
tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
folder: | |
- "tests/unitary" | |
- "tests/integration" | |
- "tests/hypothesis" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "0.4.18" | |
enable-cache: true # Enables built-in caching for uv | |
- name: Set up Python 3.12.6 | |
run: uv python install 3.12.6 | |
# Ensure Titanoboa Cache Directory Exists | |
- name: Create Cache Directory | |
run: mkdir -p /home/runner/.cache/titanoboa | |
# Install dependencies with all extras (including dev) | |
- name: Install Requirements | |
run: uv sync --extra=dev | |
# Run tests with environment variables | |
- name: Run Tests in ${{ matrix.folder }} | |
env: | |
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} | |
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} | |
run: | | |
if [ "${{ matrix.folder }}" == "tests/unitary" ]; then | |
uv run pytest ${{ matrix.folder }} -n=auto | |
else | |
uv run pytest ${{ matrix.folder }} | |
fi |