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

View File

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