|
| 1 | +# Appose Python CI Build |
| 2 | +# |
| 3 | +# Caching Strategy: |
| 4 | +# 1. Maven dependencies (via setup-java cache: 'maven') |
| 5 | +# 2. Appose environments and tool binaries (~/.local/share/appose) |
| 6 | +# - Includes pixi, uv, and micromamba executables |
| 7 | +# - Includes built environments |
| 8 | +# 3. Pixi package cache (rattler cache): |
| 9 | +# - Linux: ~/.cache/rattler/cache |
| 10 | +# - macOS: ~/Library/Caches/rattler/cache |
| 11 | +# - Windows: ~/AppData/Local/rattler/cache |
| 12 | +# 4. uv package cache: |
| 13 | +# - Linux: ~/.cache/uv |
| 14 | +# - macOS: ~/Library/Caches/uv |
| 15 | +# - Windows: ~/AppData/Local/uv/cache |
| 16 | +# 5. Micromamba package cache: |
| 17 | +# - All platforms: ~/.local/share/mamba/pkgs and ~/.mamba/pkgs |
| 18 | +# |
| 19 | +# Cache keys are based on: |
| 20 | +# - tests/resources/envs/* hash (test environment specs change) |
| 21 | +# - uv.lock hash (package dependencies change) |
| 22 | +# |
| 23 | +# This prevents redundant downloads of ~100MB+ tool binaries and packages on every CI run. |
| 24 | + |
1 | 25 | name: build |
2 | 26 |
|
3 | 27 | on: |
|
14 | 38 | build: |
15 | 39 | runs-on: ${{ matrix.os }} |
16 | 40 | strategy: |
| 41 | + fail-fast: false |
17 | 42 | matrix: |
18 | 43 | os: [ubuntu-latest, windows-latest, macos-latest] |
19 | 44 | python-version: ["3.10", "3.13"] |
|
39 | 64 | python -m pip install --upgrade pip |
40 | 65 | python -m pip install uv |
41 | 66 |
|
| 67 | + - name: Cache Appose environments and tools |
| 68 | + uses: actions/cache@v4 |
| 69 | + with: |
| 70 | + path: ~/.local/share/appose |
| 71 | + key: ${{ runner.os }}-appose-py${{ matrix.python-version }}-${{ hashFiles('tests/resources/envs/**') }}-${{ hashFiles('pyproject.toml', 'uv.lock') }} |
| 72 | + restore-keys: | |
| 73 | + ${{ runner.os }}-appose-py${{ matrix.python-version }}-${{ hashFiles('tests/resources/envs/**') }}- |
| 74 | + ${{ runner.os }}-appose-py${{ matrix.python-version }}- |
| 75 | + ${{ runner.os }}-appose- |
| 76 | +
|
| 77 | + - name: Cache Pixi packages (Rattler cache) |
| 78 | + uses: actions/cache@v4 |
| 79 | + with: |
| 80 | + path: | |
| 81 | + ~/.cache/rattler/cache |
| 82 | + ~/Library/Caches/rattler/cache |
| 83 | + ~/AppData/Local/rattler/cache |
| 84 | + key: ${{ runner.os }}-pixi-pkgs-${{ hashFiles('tests/resources/envs/**') }} |
| 85 | + restore-keys: | |
| 86 | + ${{ runner.os }}-pixi-pkgs- |
| 87 | +
|
| 88 | + - name: Cache uv packages |
| 89 | + uses: actions/cache@v4 |
| 90 | + with: |
| 91 | + path: | |
| 92 | + ~/.cache/uv |
| 93 | + ~/Library/Caches/uv |
| 94 | + ~/AppData/Local/uv/cache |
| 95 | + key: ${{ runner.os }}-uv-pkgs-${{ hashFiles('tests/resources/envs/**', 'uv.lock') }} |
| 96 | + restore-keys: | |
| 97 | + ${{ runner.os }}-uv-pkgs- |
| 98 | +
|
| 99 | + - name: Cache Micromamba packages |
| 100 | + uses: actions/cache@v4 |
| 101 | + with: |
| 102 | + path: | |
| 103 | + ~/.local/share/mamba/pkgs |
| 104 | + ~/.mamba/pkgs |
| 105 | + ~/AppData/Roaming/.mamba/pkgs |
| 106 | + ~/AppData/Roaming/mamba/pkgs |
| 107 | + key: ${{ runner.os }}-mamba-pkgs-${{ hashFiles('tests/resources/envs/**') }} |
| 108 | + restore-keys: | |
| 109 | + ${{ runner.os }}-mamba-pkgs- |
| 110 | +
|
42 | 111 | - name: Run the tests |
43 | 112 | shell: bash |
44 | 113 | env: |
|
0 commit comments