mypy & ruff #145
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: Full Testing Suite | |
| on: | |
| push: | |
| paths: | |
| - src/** | |
| - scripts/** | |
| - tests/** | |
| - pyproject.toml | |
| - uv.lock | |
| - .github/workflows/test_full.yaml | |
| workflow_dispatch: | |
| inputs: | |
| no_cleanup: | |
| description: Keep intermediate files after running tests | |
| default: false | |
| type: boolean | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: arcana | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v8.0.0 | |
| with: | |
| version: "0.11.3" | |
| enable-cache: true # not automatic on self-hosted runners | |
| - run: uv sync | |
| - name: Run all tests | |
| shell: bash | |
| run: | | |
| # Clean up stale tmpfs dirs from previous crashed runs | |
| find /dev/shm -maxdepth 1 -name 'rbc_test_*' -mmin +120 -exec rm -rf {} + 2>/dev/null || true | |
| export JOB_TMP="/dev/shm/rbc_test_$(date +%s%N)" | |
| mkdir -p $JOB_TMP | |
| echo "JOB_TMP=$JOB_TMP" >> $GITHUB_ENV | |
| echo "Job temp directory: $JOB_TMP" | |
| export PYTEST_CACHE_DIR="$JOB_TMP/.pytest_cache" | |
| export PYTHONPYCACHEPREFIX="$JOB_TMP/__pycache__" | |
| export COVERAGE_FILE="$JOB_TMP/.coverage" | |
| uv run pytest \ | |
| -n 8 \ | |
| --runner=podman \ | |
| --basetemp=$JOB_TMP/pytest-tmp \ | |
| --cov-report= \ | |
| --cov=src \ | |
| --durations=0 \ | |
| --log-level=DEBUG \ | |
| --verbose tests | |
| - name: Generate pipeline report | |
| if: always() | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| uv run scripts/visualize_pipeline.py --output $JOB_TMP/pipeline_report.png | |
| if [ -f "$JOB_TMP/pipeline_report.png" ]; then | |
| echo "## Pipeline Report" >> $GITHUB_STEP_SUMMARY | |
| echo "Download the **pipeline-report** artifact for the full visualization." >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload pipeline report | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pipeline-report | |
| path: ${{ env.JOB_TMP }}/pipeline_report.png | |
| - name: Coverage summary | |
| if: always() | |
| env: | |
| COVERAGE_FAIL: 75 | |
| shell: bash | |
| run: | | |
| uv run coverage report \ | |
| --data-file=$JOB_TMP/.coverage \ | |
| --fail-under=$COVERAGE_FAIL \ | |
| --show-missing \ | |
| --format=markdown >> $GITHUB_STEP_SUMMARY | |
| - name: Cleanup | |
| if: ${{ always() && github.event.inputs.no_cleanup != true }} | |
| shell: bash | |
| run: | | |
| echo "Cleaning up job temp directory: $JOB_TMP" | |
| echo "Temp directory size: $(du -sh $JOB_TMP 2>/dev/null | cut -f1)" | |
| rm -rf $JOB_TMP |