+ use env vars for deps cache key & cache dir

+ upate cache step id
This commit is contained in:
ota 2023-12-16 16:44:23 +02:00 committed by otavepto
parent 9530f4111e
commit 7ddae813f9
2 changed files with 25 additions and 21 deletions

View File

@ -13,6 +13,8 @@ env:
# Expected format {owner}/{repo}.
DEPS_REPO: 'otavepto/gbe_fork-deps'
THIRD_PARTY_BASE_DIR: 'third-party'
DEPS_CACHE_KEY: emu-deps-linux
DEPS_CACHE_DIR: build-linux-deps
jobs:
dependencies:
@ -20,20 +22,20 @@ jobs:
steps:
- name: Lookup cache for deps
id: cache-deps-linux
id: emu-deps-cache-step
uses: actions/cache@v3
with:
key: ${{ runner.os }}-deps
path: build-linux-deps
key: ${{ env.DEPS_CACHE_KEY }}
path: ${{ env.DEPS_CACHE_DIR }}
lookup-only: true
# we need the repo to build the deps since it has the build scripts
- name: Checkout branch
if: steps.cache-deps-linux.outputs.cache-hit != 'true'
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Clone third-party deps (deps/linux)
if: steps.cache-deps-linux.outputs.cache-hit != 'true'
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: "${{env.DEPS_REPO}}"
@ -42,7 +44,7 @@ jobs:
lfs: true
- name: Clone third-party deps (deps/common)
if: steps.cache-deps-linux.outputs.cache-hit != 'true'
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: "${{env.DEPS_REPO}}"
@ -51,7 +53,7 @@ jobs:
lfs: true
- name: Build deps
if: steps.cache-deps-linux.outputs.cache-hit != 'true'
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
shell: bash
run: sudo chmod 777 build_linux_deps.sh && sudo ./build_linux_deps.sh
@ -66,11 +68,11 @@ jobs:
### deps
- name: Grab cache for deps
id: cache-deps-linux
id: emu-deps-cache-step
uses: actions/cache@v3
with:
key: ${{ runner.os }}-deps
path: build-linux-deps
key: ${{ env.DEPS_CACHE_KEY }}
path: ${{ env.DEPS_CACHE_DIR }}
fail-on-cache-miss: true
- name: Install required packages

View File

@ -13,6 +13,8 @@ env:
# Expected format {owner}/{repo}.
DEPS_REPO: 'otavepto/gbe_fork-deps'
THIRD_PARTY_BASE_DIR: 'third-party'
DEPS_CACHE_KEY: emu-deps-win
DEPS_CACHE_DIR: build-win-deps
jobs:
dependencies:
@ -20,20 +22,20 @@ jobs:
steps:
- name: Lookup cache for deps
id: cache-deps-win
id: emu-deps-cache-step
uses: actions/cache@v3
with:
key: ${{ runner.os }}-deps
path: build-win-deps
key: ${{ env.DEPS_CACHE_KEY }}
path: ${{ env.DEPS_CACHE_DIR }}
lookup-only: true
# we need the repo to build the deps since it has the build scripts
- name: Checkout branch
if: steps.cache-deps-win.outputs.cache-hit != 'true'
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Clone third-party deps (deps/win)
if: steps.cache-deps-win.outputs.cache-hit != 'true'
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: "${{env.DEPS_REPO}}"
@ -42,7 +44,7 @@ jobs:
lfs: true
- name: Clone third-party deps (deps/common)
if: steps.cache-deps-win.outputs.cache-hit != 'true'
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: "${{env.DEPS_REPO}}"
@ -51,7 +53,7 @@ jobs:
lfs: true
- name: Clone third-party deps (common/win)
if: steps.cache-deps-win.outputs.cache-hit != 'true'
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: "${{env.DEPS_REPO}}"
@ -60,7 +62,7 @@ jobs:
lfs: true
- name: Build deps
if: steps.cache-deps-win.outputs.cache-hit != 'true'
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
shell: cmd
working-directory: ${{ github.workspace }}
run: build_win_deps.bat
@ -76,11 +78,11 @@ jobs:
### deps
- name: Grab cache for deps
id: cache-deps-win
id: emu-deps-cache-step
uses: actions/cache@v3
with:
key: ${{ runner.os }}-deps
path: build-win-deps
key: ${{ env.DEPS_CACHE_KEY }}
path: ${{ env.DEPS_CACHE_DIR }}
fail-on-cache-miss: true
- name: Clone third-party build helpers (common/win)