Skip to content

Commit 31eee16

Browse files
authored
Improve cache for architectures (#26)
* Add runner.arch for cache.key Users might use this action to prepare multiple jobs with the same OS but different architectures, for example, macOS' x86_64 and arm64, Linux's x86_64 and arm64 and even Windows x86_64 and arm64. This CL just add architecture information of runner to make cache workable for this special scenario. Signed-off-by: utzcoz <utzcoz@outlook.com> * ci: Add macos-14, macos + arm64 runner target It can be used to test cache between same OS but different architectures. This CL also adds a small step to print runner's os and arch information for debug purpose. Signed-off-by: utzcoz <utzcoz@outlook.com> * ci: Enable pull_request on main branch to trigger CI for PR Signed-off-by: utzcoz <utzcoz@outlook.com> --------- Signed-off-by: utzcoz <utzcoz@outlook.com>
1 parent 466e805 commit 31eee16

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Setup
22
on:
33
push:
4+
pull_request:
5+
branches: [ main ]
46
workflow_dispatch:
57
inputs:
68
extra_tests:
@@ -19,7 +21,7 @@ on:
1921
oses:
2022
description: 'Matrix OSes'
2123
required: true
22-
default: '[ "ubuntu-latest", "windows-latest", "windows-2022", "macos-12" ]'
24+
default: '[ "ubuntu-latest", "windows-latest", "windows-2022", "macos-13", "macos-14" ]'
2325
jobs:
2426
setup-all-matrix:
2527
if: ${{ github.event.inputs.extra_tests == 'true' || github.event.inputs.extra_tests == 'matrix' }}
@@ -35,6 +37,9 @@ jobs:
3537
vulkan-query-version: ${{ matrix.version }}
3638
vulkan-components: ${{ github.event.inputs.components }}
3739
vulkan-use-cache: true
40+
- name: Print runner configurations
41+
run: |
42+
echo runner os: ${{ runner.os }}, arch: ${{ runner.arch }}
3843
- name: checkout seanmiddleditch/gha-setup-vsdevenv@v4
3944
if: runner.os == 'Windows'
4045
uses: actions/checkout@v4

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ runs:
6868
uses: actions/cache@v4
6969
with:
7070
path: VULKAN_SDK
71-
key: ${{ runner.os }}-vulkan-cached-sdk-${{ hashFiles('_vulkan_build/cache-key.txt') }}
71+
key: ${{ runner.os }}-${{ runner.arch }}-vulkan-cached-sdk-${{ hashFiles('_vulkan_build/cache-key.txt') }}
7272

7373
- name: Configure Vulkan SDK Build Prerequisites
7474
if: steps.vulkan-cached-sdk.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)