Files
kornia--kornia/.github/workflows/scheduled_test_cpu.yml
T
wehub-resource-sync 3a2c66702c
Tests on CPU (scheduled) / check-skip (push) Has been cancelled
Tests on CPU (scheduled) / pre-tests (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-ubuntu (float32) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-ubuntu (float64) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.11, float32, 2.5.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.11, float32, 2.9.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.11, float64, 2.5.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.11, float64, 2.9.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.12, float32, 2.5.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.12, float32, 2.9.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.12, float64, 2.5.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.12, float64, 2.9.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.13, float32, 2.9.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-windows (3.13, float64, 2.9.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-mac (3.11, float32, 2.5.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-mac (3.11, float32, 2.9.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-mac (3.12, float32, 2.5.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-mac (3.12, float32, 2.9.1) (push) Has been cancelled
Tests on CPU (scheduled) / tests-cpu-mac (3.13, float32, 2.9.1) (push) Has been cancelled
Tests on CPU (scheduled) / coverage (push) Has been cancelled
Tests on CPU (scheduled) / typing (push) Has been cancelled
Tests on CPU (scheduled) / tutorials (push) Has been cancelled
Tests on CPU (scheduled) / docs (push) Has been cancelled
Lint / TOML Format (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:49:27 +08:00

206 lines
6.4 KiB
YAML

name: Tests on CPU (scheduled)
on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- '*.md'
- 'LICENSE'
- 'COPYRIGHT'
schedule:
- cron: '0 4 * * *'
workflow_call:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-skip:
# For scheduled runs, check if only documentation files changed
# If so, skip the expensive test runs
runs-on: ubuntu-latest
outputs:
should-skip: ${{ steps.check.outputs.should-skip }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 2 # Need at least 2 commits to compare
- name: Check if only docs changed
id: check
run: |
# For non-schedule events, always run tests
if [[ "${{ github.event_name }}" != "schedule" ]]; then
echo "should-skip=false" >> "$GITHUB_OUTPUT"
echo "Not a scheduled run, will proceed with tests"
exit 0
fi
# For scheduled runs, check if only documentation files changed
# Get the last commit on main
LAST_COMMIT=$(git rev-parse HEAD)
# Get list of changed files in the last commit
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r $LAST_COMMIT)
# Check if all changed files are in paths-ignore patterns
SHOULD_SKIP="true"
for file in $CHANGED_FILES; do
# Check if file matches any ignore pattern
if [[ ! "$file" =~ ^docs/ ]] && \
[[ ! "$file" =~ \.md$ ]] && \
[[ "$file" != "LICENSE" ]] && \
[[ "$file" != "COPYRIGHT" ]]; then
SHOULD_SKIP="false"
break
fi
done
echo "should-skip=$SHOULD_SKIP" >> "$GITHUB_OUTPUT"
echo "Changed files: $CHANGED_FILES"
echo "Should skip: $SHOULD_SKIP"
pre-tests:
runs-on: ubuntu-latest
needs: [check-skip]
if: needs.check-skip.outputs.should-skip == 'false'
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-cpu-ubuntu:
needs: [check-skip, pre-tests]
if: needs.check-skip.outputs.should-skip == 'false'
strategy:
fail-fast: false
matrix:
pytorch-dtype: ["float32", "float64"]
uses: ./.github/workflows/tests.yml
with:
os: "ubuntu-latest"
python-version: '["3.11", "3.12", "3.13"]'
pytorch-version: '["2.1.2", "2.2.2", "2.3.1", "2.4.0", "2.5.1", "2.9.1"]'
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-
tests-cpu-windows:
needs: [check-skip, pre-tests]
if: needs.check-skip.outputs.should-skip == 'false'
strategy:
fail-fast: false
matrix:
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
- python-version: "3.13"
pytorch-version: "2.5.1"
uses: ./.github/workflows/tests.yml
with:
os: "windows-latest"
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-
tests-cpu-mac:
needs: [check-skip, pre-tests]
if: needs.check-skip.outputs.should-skip == 'false'
strategy:
fail-fast: false
matrix:
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 macOS
- python-version: "3.13"
pytorch-version: "2.5.1"
# macOS only runs float32 tests
- pytorch-dtype: "float64"
uses: ./.github/workflows/tests.yml
with:
os: "macos-latest"
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-
coverage:
needs: [check-skip, pre-tests]
if: needs.check-skip.outputs.should-skip == 'false'
uses: ./.github/workflows/coverage.yml
with:
cache-path: weights/
cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}
cache-restore-keys: |
model-weights-${{ needs.pre-tests.outputs.hash }}
model-weights-
typing:
needs: [check-skip]
if: needs.check-skip.outputs.should-skip == 'false'
uses: ./.github/workflows/typecheck.yml
tutorials:
needs: [check-skip]
if: needs.check-skip.outputs.should-skip == 'false'
uses: ./.github/workflows/tutorials.yml
docs:
needs: [check-skip, pre-tests]
if: needs.check-skip.outputs.should-skip == 'false'
uses: ./.github/workflows/docs.yml
with:
python-version: '["3.11"]'
cache-path: weights/
cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}
cache-restore-keys: |
model-weights-${{ needs.pre-tests.outputs.hash }}
model-weights-