feat (CI): cache model weights #7
This file contains 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: Tests on CPU (scheduled) | ||
on: | ||
push: | ||
branches: [main, test-me-*] | ||
schedule: | ||
- cron: "0 4 * * *" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
pre-tests: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
hash: ${{ steps.hashid.outputs.weights-hash }} | ||
steps: | ||
- uses: kornia/workflows/.github/actions/[email protected] | ||
- uses: actions/cache@v4 | ||
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: 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: [pre-tests] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# os: ['Ubuntu-latest', 'Windows-latest', 'MacOS-latest'] | ||
pytorch-dtype: ['float32', 'float64'] | ||
<<<<<<< HEAD | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
======= | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
>>>>>>> 9890c9de (chore: bump actions to v1.12.0) | ||
with: | ||
os: 'Ubuntu-latest' | ||
python-version: '["3.8", "3.9", "3.10", "3.11", "3.12"]' | ||
pytorch-version: '["1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2", "2.3.1", "2.4.0"]' | ||
pytorch-dtype: ${{ matrix.pytorch-dtype }} | ||
pytest-extra: '--runslow' | ||
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: [pre-tests] | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
pytorch-dtype: ['float32', 'float64'] | ||
<<<<<<< HEAD | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
======= | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
>>>>>>> 9890c9de (chore: bump actions to v1.12.0) | ||
with: | ||
os: 'Windows-latest' | ||
python-version: '["3.12"]' | ||
pytorch-version: '["1.9.1", "2.4.0"]' | ||
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: [pre-tests] | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
pytorch-dtype: ['float32', 'float64'] | ||
<<<<<<< HEAD | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
======= | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
>>>>>>> 9890c9de (chore: bump actions to v1.12.0) | ||
with: | ||
os: 'MacOS-latest' | ||
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: | ||
<<<<<<< HEAD | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
typing: | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
tutorials: | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
docs: | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
======= | ||
needs: [pre-tests] | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
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: | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
tutorials: | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
docs: | ||
needs: [pre-tests] | ||
uses: kornia/workflows/.github/workflows/[email protected] | ||
>>>>>>> 9890c9de (chore: bump actions to v1.12.0) | ||
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- |