Skip to content

Commit

Permalink
Add a cargo key and use it to update caches (AOMediaCodec#2485)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud authored Oct 23, 2024
1 parent aa9f740 commit 2097078
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,31 @@ runs:
shell: bash
- name: Generate cargo cache key
if: ${{ inputs.use-rust == 'true' }}
id: cargo-key
run: |
echo "key=cargo-registry-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ inputs.extra-key }}-${{ hashFiles('.github/action/**', steps.workflow-info.outputs.path, 'CMakeLists.txt', 'cmake/Modules/Findrav1e.cmake', 'cmake/Modules/LocalRav1e.cmake', 'ext/rav1e.cmd') }}" >> "$GITHUB_OUTPUT"
echo "CARGO_KEY=cargo-`cargo --version|cut -d' ' -f2`-${{ hashFiles('.github/action/**', steps.workflow-info.outputs.path, 'CMakeLists.txt', 'cmake/Modules/Findrav1e.cmake', 'cmake/Modules/LocalRav1e.cmake', 'ext/rav1e.cmd') }}" >> $GITHUB_ENV
echo "CARGO_CACHE_KEY=${{ env.CARGO_KEY }}-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ inputs.extra-key }}" >> $GITHUB_ENV
shell: bash
- name: Generate empty cargo cache key
if: ${{ inputs.use-rust != 'true' }}
run: |
echo "CARGO_KEY=cargo-none" >> $GITHUB_ENV
shell: bash
- name: Cache all of cargo
if: ${{ inputs.use-rust == 'true' }}
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
continue-on-error: true
with:
path: ~/.cargo
key: ${{ steps.cargo-key.outputs.key }}-${{ github.run_id }}
restore-keys: ${{ steps.cargo-key.outputs.key }}
key: ${{ env.CARGO_CACHE_KEY }}-${{ github.run_id }}
restore-keys: ${{ env.CARGO_CACHE_KEY }}
- name: Cache external dependencies in ext
id: cache-ext
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ext
key: ext-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ inputs.extra-key }}-${{ env.MESON_KEY }}-${{ hashFiles('.github/action/**', steps.workflow-info.outputs.path, 'ext/*.cmd', 'ext/*.sh') }}
key: ext-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ inputs.extra-key }}-${{ env.CARGO_KEY }}-${{ env.MESON_KEY }}-${{ hashFiles('.github/action/**', steps.workflow-info.outputs.path, 'ext/*.cmd', 'ext/*.sh') }}
- name: Cache external dependencies in build/_deps
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: build/_deps
key: deps-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ inputs.extra-key }}-${{ env.MESON_KEY }}-${{ hashFiles('.github/action/**', steps.workflow-info.outputs.path, 'CMakeLists.txt', 'cmake/Modules/*') }}
key: deps-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ inputs.extra-key }}-${{ env.CARGO_KEY }}-${{ env.MESON_KEY }}-${{ hashFiles('.github/action/**', steps.workflow-info.outputs.path, 'CMakeLists.txt', 'cmake/Modules/*') }}

0 comments on commit 2097078

Please sign in to comment.