-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (52 loc) · 1.58 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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