From 2f47e49de41a2690daea890fd211114bd877ad0c Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Fri, 12 Jul 2024 14:37:45 +0200 Subject: [PATCH] Use actions/cache/restore for read-only caches Using the restore action avoids the post step that tries to upload new files to the cache at the end of the job, which would not make sense in theses cases. --- .github/workflows/build-multi-os.yml | 42 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-multi-os.yml b/.github/workflows/build-multi-os.yml index cea3b6d2..4da2a9d5 100644 --- a/.github/workflows/build-multi-os.yml +++ b/.github/workflows/build-multi-os.yml @@ -190,7 +190,7 @@ jobs: python -m pip install -r windows-build\windows_build_requirements.txt - name: Restore cached firmware id: firmware-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/resources/base/ayab/firmware/*.hex key: firmware-${{ steps.vars.outputs.manifest }} @@ -198,7 +198,7 @@ jobs: fail-on-cache-miss: true - name: Restore cached gui files (1) id: gui1-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/*_gui.py key: gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }} @@ -206,7 +206,7 @@ jobs: fail-on-cache-miss: true - name: Restore cached gui files (2) id: gui2-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/engine/*_gui.py key: gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }} @@ -214,7 +214,7 @@ jobs: fail-on-cache-miss: true - name: Restore cached logo id: logo-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/ayab_logo_rc.py key: logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }} @@ -222,7 +222,7 @@ jobs: fail-on-cache-miss: true - name: Restore cached graphics id: e-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/engine/*_rc.py key: e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }} @@ -230,7 +230,7 @@ jobs: fail-on-cache-miss: true - name: Restore cached translation files id: qm-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/resources/base/ayab/translations/*.qm key: qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }} @@ -238,7 +238,7 @@ jobs: fail-on-cache-miss: true - name: Restore cached `base.json` file id: base-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/build/settings/base.json key: base-${{ steps.vars.outputs.tag }} @@ -330,49 +330,49 @@ jobs: python -m pip install --no-binary charset_normalizer -r requirements.build.txt - name: Restore cached firmware id: firmware-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/resources/base/ayab/firmware/*.hex key: firmware-${{ steps.vars.outputs.manifest }} fail-on-cache-miss: true - name: Restore cached gui files (1) id: gui1-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/*_gui.py key: gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }} fail-on-cache-miss: true - name: Restore cached gui files (2) id: gui2-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/engine/*_gui.py key: gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }} fail-on-cache-miss: true - name: Restore cached logo id: logo-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/ayab_logo_rc.py key: logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }} fail-on-cache-miss: true - name: Restore cached graphics id: e-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/engine/*_rc.py key: e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }} fail-on-cache-miss: true - name: Restore cached translation files id: qm-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/resources/base/ayab/translations/*.qm key: qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }} fail-on-cache-miss: true - name: Restore cached `base.json` file id: base-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/build/settings/base.json key: base-${{ steps.vars.outputs.tag }} @@ -460,49 +460,49 @@ jobs: echo "opt/${{steps.vars.outputs.python}}/bin" >> $GITHUB_PATH - name: Restore cached firmware id: firmware-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/resources/base/ayab/firmware/*.hex key: firmware-${{ steps.vars.outputs.manifest }} fail-on-cache-miss: true - name: Restore cached gui files (1) id: gui1-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/*_gui.py key: gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }} fail-on-cache-miss: true - name: Restore cached gui files (2) id: gui2-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/engine/*_gui.py key: gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }} fail-on-cache-miss: true - name: Restore cached logo id: logo-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/ayab_logo_rc.py key: logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }} fail-on-cache-miss: true - name: Restore cached graphics id: e-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/python/main/ayab/engine/*_rc.py key: e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }} fail-on-cache-miss: true - name: Restore cached translation files id: qm-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/main/resources/base/ayab/translations/*.qm key: qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }} fail-on-cache-miss: true - name: Restore cached `base.json` file id: base-cache - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: src/build/settings/base.json key: base-${{ steps.vars.outputs.tag }}