host magma binary on dropbox #2338
Workflow file for this run
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: on_pr | |
| on: | |
| # Trigger the workflow on push or pull request, | |
| # but only for the main branch | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| run-linters: | |
| timeout-minutes: 15 | |
| name: Run PR Checks | |
| runs-on: ubuntu-latest | |
| # paths-ignore: | |
| # - 'docs/**' # Ignores changes within the 'docs' directory | |
| # - '**/*.md' # Ignores changes to any markdown files | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v7 | |
| - uses: dorny/paths-filter@v4 | |
| id: changes | |
| name: Check whether non-markdown files changed | |
| with: | |
| predicate-quantifier: 'every' | |
| filters: | | |
| nonmark: | |
| - '**/*' | |
| - '!**/*.md' # treat any non-MD change as "code" | |
| - name: Docs-only fast path | |
| if: steps.changes.outputs.nonmark != 'true' | |
| run: | | |
| echo "Docs-only change; skipping tests/linters." | |
| - uses: prefix-dev/setup-pixi@v0.10.0 | |
| name: Setup Pixi Environment | |
| if: steps.changes.outputs.nonmark == 'true' | |
| with: | |
| pixi-version: v0.67.2 | |
| cache: true | |
| - name: Cache R Packages | |
| if: steps.changes.outputs.nonmark == 'true' | |
| uses: actions/cache@v6 | |
| id: cache-r | |
| with: | |
| path: r-libs | |
| key: ${{ runner.os }}-r-libs-${{ hashFiles('pixi.lock') }}-v1 | |
| - name: Install R packages | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke install-r-packages | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download figures | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke pfig | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check that we can build docs | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r mkdocs build --strict | |
| - name: Check formatting with ruff | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke formatcheck | |
| - name: Check that markdown files ending in tables have trailing newlines | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke check-table-trailing-newlines | |
| - name: Lint using ruff | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke lintcheck | |
| - name: Check doc spelling using typos | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke spellcheck-docs | |
| - name: Check code spelling using typos | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke spellcheck-src | |
| - name: Lint imports | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke checkimports | |
| # - name: Check __init__.py files | |
| # if: steps.changes.outputs.nonmark == 'true' | |
| # run: pixi r invoke check-init-files | |
| - name: Check links | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke check-local-links | |
| - name: Check types with ty | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke typecheck | |
| - name: Lint with actionlint | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke lint-actions | |
| - name: Compute cache date | |
| if: steps.changes.outputs.nonmark == 'true' | |
| id: cache-date | |
| run: echo "date=$(date -u +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" | |
| - name: Restore testmon cache # testmon cache can be used to skip tests if their dependencies have not changed | |
| if: steps.changes.outputs.nonmark == 'true' | |
| uses: actions/cache@v6 | |
| with: | |
| # SQLite runs in WAL mode on CI; the actual data lives in .testmondata-wal | |
| # until checkpointed, so we must cache the WAL/SHM sidecars too. | |
| path: | | |
| .testmondata | |
| .testmondata-wal | |
| .testmondata-shm | |
| key: testmon-v3-${{ runner.os }}-${{ hashFiles('pyproject.toml', 'pixi.lock') }}-${{ steps.cache-date.outputs.date }} | |
| restore-keys: | | |
| testmon-v3-${{ runner.os }}-${{ hashFiles('pyproject.toml', 'pixi.lock') }}- | |
| - name: Run tests | |
| if: steps.changes.outputs.nonmark == 'true' | |
| run: pixi r invoke test # run unit and integration tests | |
| - name: Inspect testmon artifacts | |
| if: always() && steps.changes.outputs.nonmark == 'true' | |
| run: | | |
| echo "github.workspace: ${{ github.workspace }}" | |
| echo "PWD during this step: $(pwd)" | |
| echo "--- workspace .testmondata* ---" | |
| ls -la .testmondata* 2>/dev/null || echo "no .testmondata in workspace" | |
| echo "--- find under /home/runner ---" | |
| find /home/runner -name '.testmondata*' 2>/dev/null | |
| echo "--- pixi shell view ---" | |
| # shellcheck disable=SC2016 # $(pwd) is intentionally evaluated by the inner bash -c | |
| pixi r bash -c 'echo "pixi pwd: $(pwd)"; ls -la .testmondata* 2>/dev/null || echo "no .testmondata in pixi cwd"' |