name: Tests on CPU (PR) on: pull_request: branches: [main] types: [opened, reopened, synchronize, ready_for_review] paths-ignore: - 'docs/**' - '*.md' - 'LICENSE' - 'COPYRIGHT' workflow_dispatch: permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: pre-tests: runs-on: ubuntu-latest outputs: hash: ${{ steps.hashid.outputs.weights-hash }} steps: - name: Checkout repository uses: actions/checkout@v6 - name: Setup pixi uses: prefix-dev/setup-pixi@v0.9.6 with: pixi-version: v0.40.0 cache: true - uses: actions/cache@v5 id: cache-weights with: path: weights/ key: model-weights-${{ hashFiles('.github/download-models-weights.py') }} enableCrossOsArchive: true - name: Download models weights... if: steps.cache-weights.outputs.cache-hit != 'true' run: pixi run uv run python .github/download-models-weights.py -t weights/ - name: write hashid id: hashid run: echo "weights-hash=${{ hashFiles('.github/download-models-weights.py') }}" >> "$GITHUB_OUTPUT" tests: needs: [pre-tests] strategy: fail-fast: false matrix: os: ["ubuntu-latest", "windows-latest", "macos-latest"] pytorch-dtype: ["float32", "float64"] python-version: ["3.11", "3.12", "3.13"] pytorch-version: ["2.5.1", "2.9.1"] exclude: # PyTorch 2.5.1 doesn't have wheels for Python 3.13 on Windows - os: windows-latest python-version: "3.13" pytorch-version: "2.5.1" # PyTorch 2.5.1 doesn't have wheels for Python 3.13 on macOS - os: macos-latest python-version: "3.13" pytorch-version: "2.5.1" # macOS only runs float32 tests - os: macos-latest pytorch-dtype: "float64" uses: ./.github/workflows/tests.yml with: os: ${{ matrix.os }} python-version: '["${{ matrix.python-version }}"]' pytorch-version: '["${{ matrix.pytorch-version }}"]' pytorch-dtype: ${{ matrix.pytorch-dtype }} cache-path: weights/ cache-key: model-weights-${{ needs.pre-tests.outputs.hash }} cache-restore-keys: | model-weights-${{ needs.pre-tests.outputs.hash }} model-weights- typecheck: needs: [pre-tests] uses: ./.github/workflows/typecheck.yml tutorials: needs: [pre-tests] uses: ./.github/workflows/tutorials.yml collector: needs: [tests, typecheck] if: always() runs-on: ubuntu-latest steps: - name: check for failures if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') run: echo job failed && exit 1