Commit 45aa6a38 authored by Jerome Wu's avatar Jerome Wu

Use a step to get git commit hash

parent 5c9b76ba
...@@ -41,17 +41,19 @@ jobs: ...@@ -41,17 +41,19 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- name: Get commit hash
id: get-commit-hash
run: |
echo "::set-output name=hash::$(git rev-parse --short HEAD)"
- name: Cache libs - name: Cache libs
uses: actions/cache@v2 uses: actions/cache@v2
env:
GIT_HASH: $(git rev-parse --short HEAD)
with: with:
path: | path: |
build build
wasm/cache wasm/cache
key: ${{ env.CACHE_KEY_PREFIX }}-${{ env.GIT_HASH }}-${{ matrix.script }} key: ${{ env.CACHE_KEY_PREFIX }}-${{ steps.get-commit-hash.outputs.hash }}-${{ matrix.script }}
restore-keys: | restore-keys: |
${{ env.CACHE_KEY_PREFIX }}-${{ env.GIT_HASH }}- ${{ env.CACHE_KEY_PREFIX }}-${{ steps.get-commit-hash.outputs.hash }}-
- name: List cached libs - name: List cached libs
run: ls build/lib || true run: ls build/lib || true
- name: Build FFMpeg Libs - name: Build FFMpeg Libs
...@@ -63,6 +65,10 @@ jobs: ...@@ -63,6 +65,10 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- name: Get commit hash
id: get-commit-hash
run: |
echo "::set-output name=hash::$(git rev-parse --short HEAD)"
- name: Cache multiple paths - name: Cache multiple paths
uses: actions/cache@v2 uses: actions/cache@v2
env: env:
...@@ -71,9 +77,9 @@ jobs: ...@@ -71,9 +77,9 @@ jobs:
path: | path: |
build build
wasm/cache wasm/cache
key: ${{ env.CACHE_KEY_PREFIX }}-${{ env.GIT_HASH }}-ffmpeg key: ${{ env.CACHE_KEY_PREFIX }}-${{ steps.get-commit-hash.outputs.hash }}-ffmpeg
restore-keys: | restore-keys: |
${{ env.CACHE_KEY_PREFIX }}-${{ env.GIT_HASH }}- ${{ env.CACHE_KEY_PREFIX }}-${{ steps.get-commit-hash.outputs.hash }}-
- name: List cached libs - name: List cached libs
run: ls build/lib || true run: ls build/lib || true
- name: Build FFMpeg - name: Build FFMpeg
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment