|
48 | 48 | docker_cache: |
49 | 49 | name: "Build ${{ matrix.arch }} Docker image" |
50 | 50 | runs-on: ${{ matrix.runner }} |
| 51 | + outputs: |
| 52 | + cache_scope: ${{ steps.cache_timestamp.outputs.period }} |
51 | 53 |
|
52 | 54 | strategy: |
53 | 55 | fail-fast: false |
|
59 | 61 | runner: ubuntu-24.04-arm |
60 | 62 |
|
61 | 63 | steps: |
| 64 | + - name: Get cache validity period |
| 65 | + id: cache_timestamp |
| 66 | + run: echo "period=$(($(date +%V) / 4))" >> "$GITHUB_OUTPUT" |
| 67 | + |
62 | 68 | - name: Set up Docker Buildx |
63 | 69 | uses: docker/setup-buildx-action@v3 |
64 | 70 | with: |
|
70 | 76 | uses: docker/build-push-action@v6 |
71 | 77 | with: |
72 | 78 | file: ./ci/linux-debian.Dockerfile |
73 | | - cache-from: type=gha,scope=${{ runner.arch }} |
74 | | - cache-to: type=gha,scope=${{ runner.arch }},mode=min |
| 79 | + cache-from: type=gha,scope=${{ runner.arch }}-${{ steps.cache_timestamp.outputs.period }} |
| 80 | + cache-to: type=gha,scope=${{ runner.arch }}-${{ steps.cache_timestamp.outputs.period }},mode=min |
75 | 81 |
|
76 | 82 | x86_64-debian: |
77 | 83 | name: "x86_64: Linux (Debian stable)" |
@@ -117,6 +123,7 @@ jobs: |
117 | 123 | uses: ./.github/actions/run-in-docker-action |
118 | 124 | with: |
119 | 125 | dockerfile: ./ci/linux-debian.Dockerfile |
| 126 | + scope: ${{ runner.arch }}-${{ needs.docker_cache.outputs.cache_scope }} |
120 | 127 | command: ./ci/ci.sh |
121 | 128 |
|
122 | 129 | - &PRINT_LOGS |
@@ -636,6 +643,7 @@ jobs: |
636 | 643 | uses: ./.github/actions/run-in-docker-action |
637 | 644 | with: |
638 | 645 | dockerfile: ./ci/linux-debian.Dockerfile |
| 646 | + scope: ${{ runner.arch }}-${{ needs.docker_cache.outputs.cache_scope }} |
639 | 647 | command: | |
640 | 648 | g++ -Werror include/*.h |
641 | 649 | clang -Werror -x c++-header include/*.h |
|
0 commit comments