ci: update actions to latest versions, bump Python to >=3.11 #69
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: Tests | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: [created] | |
| jobs: | |
| tests: | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| python-version: ['3.11', '3.12', '3.13', '3.14'] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install platformdirs for cache setup | |
| run: uv pip install --system platformdirs | |
| - name: Get model cache directory and config hash | |
| id: model-cache-dir | |
| shell: python | |
| run: | | |
| from platformdirs import PlatformDirs | |
| import hashlib | |
| import os | |
| cache_dir = PlatformDirs(appname='iscc-sct', appauthor='iscc').user_data_dir | |
| print(f"dir={cache_dir}") | |
| with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: | |
| print(f"dir={cache_dir}", file=fh) | |
| # Compute hash of models_config.py | |
| with open('iscc_sct/models_config.py', 'rb') as f: | |
| config_hash = hashlib.md5(f.read()).hexdigest() | |
| print(f"hash={config_hash}") | |
| with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: | |
| print(f"hash={config_hash}", file=fh) | |
| - name: Cache ONNX models | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.model-cache-dir.outputs.dir }} | |
| key: ${{ runner.os }}-onnx-models-${{ steps.model-cache-dir.outputs.hash }} | |
| restore-keys: | | |
| ${{ runner.os }}-onnx-models- | |
| - name: Install Dependencies | |
| run: uv sync --extra demo --group dev | |
| - name: Install ONNX models | |
| run: uv run iscc-sct install --quiet | |
| - name: Run Tests | |
| run: uv run pytest --cov=iscc_sct --cov-report=xml -v tests |