|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [main, develop] |
| 5 | + paths: ["src/**", "tests/**", ".github/workflows/ci.yml"] |
| 6 | + pull_request: |
| 7 | + branches: [main, develop] |
| 8 | + paths: ["src/**", "tests/**", ".github/workflows/ci.yml"] |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +jobs: |
| 12 | + CI: |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest] |
| 17 | + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Install Rye |
| 23 | + run: | |
| 24 | + curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash |
| 25 | + echo "$HOME/.rye/shims" >> $GITHUB_PATH |
| 26 | +
|
| 27 | + - name: Install external tool dependencies |
| 28 | + run: | |
| 29 | + sudo apt update -y |
| 30 | + sudo apt install -y graphviz libgraphviz-dev |
| 31 | + if: ${{ matrix.os=='ubuntu-latest' }} |
| 32 | + |
| 33 | + - name: Setup Python ${{matrix.python-version}} & Dependencies |
| 34 | + run: | |
| 35 | + rye pin ${{ matrix.python-version }} |
| 36 | + rye sync --update-all --all-features |
| 37 | +
|
| 38 | + - name: Run ruff lint check |
| 39 | + run: rye run ruff check --diff |
| 40 | + |
| 41 | + - name: Run ruff format check |
| 42 | + run: rye run ruff format --check --diff |
| 43 | + |
| 44 | + - name: Run pytest |
| 45 | + run: rye run pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src | tee pytest-coverage.txt |
| 46 | + |
| 47 | + - name: Pytest Coverage Comment |
| 48 | + uses: MishaKav/pytest-coverage-comment@main |
| 49 | + with: |
| 50 | + pytest-coverage-path: pytest-coverage.txt |
| 51 | + junitxml-path: pytest.xml |
| 52 | + if: ${{ matrix.os=='ubuntu-latest' && matrix.python-version=='3.12' && !env.ACT }} |
0 commit comments