Merge pull request #33 from Chainscore/feat/spec-update-apr-26 #99
This file contains hidden or 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: Tests | |
| on: | |
| pull_request: | |
| branches: [ main, dev ] | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| workflow_call: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y git gcc g++ python3-dev make swig libgmp-dev libmpfr-dev libmpc-dev | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --extra dev | |
| - name: Run ruff check | |
| run: uv run --with ruff ruff check . | |
| - name: Run ruff format check | |
| run: uv run --with ruff ruff format --check . | |
| - name: Setup environment (blst + cython) | |
| run: | | |
| uv run python scripts/setup_env.py | |
| - name: Run tests | |
| env: | |
| PYTHONPATH: . | |
| run: | | |
| uv run pytest tests/ \ | |
| -n auto \ | |
| --cov=dot_ring \ | |
| --cov-report=term-missing \ | |
| --cov-report=xml \ | |
| --cov-fail-under=80 \ | |
| -v \ | |
| --tb=short | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |