Skip to content

Commit

Permalink
Add workflow ID to cache key and cache key override option (#40)
Browse files Browse the repository at this point in the history
* Add option to override cache key. Add workflow name to default cache key.

Fixes Hardcoded cache key prevents multiple workflows or jobs from caching emsdk #20

* bump minor versions of dependencies

* Update @types/node to 20.x.y

* only run CI on master
  • Loading branch information
mymindstorm committed Jan 22, 2024
1 parent d233ac1 commit 7488110
Show file tree
Hide file tree
Showing 7 changed files with 35,188 additions and 14,208 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: "Run"
on: [pull_request, push]
on:
push:
branches:
- "master"

jobs:
defaults:
Expand All @@ -15,13 +18,13 @@ jobs:
actions-use-cache-test:
runs-on: ubuntu-latest
steps:
- name: Setup emsdk (use cache if found, create otherwise)
- name: Setup emsdk (use cache if found, create otherwise)
uses: mymindstorm/setup-emsdk@master
with:
version: 2.0.20
actions-cache-folder: 'emsdk-cache-folder'
no-cache: true

- name: Verify
run: emcc -v
no-install:
Expand All @@ -36,12 +39,12 @@ jobs:
tot:
runs-on: ubuntu-latest
steps:
- name: Setup emsdk (use cache if found, create otherwise)
- name: Setup emsdk (use cache if found, create otherwise)
uses: mymindstorm/setup-emsdk@master
with:
version: tot
no-cache: true
update-tags: true

- name: Verify
run: emcc -v
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ inputs:
actions-cache-folder:
description: "Directory to cache emsdk in. This folder will go under $GITHUB_HOME (I.e. build dir) and be cached using @actions/cache."
default: ''
cache-key:
description: "Override the cache key. By default, it is `{Github workflow name}-{Emscripten version}-{OS type}-${CPU architecture}`."
default: ''
update:
description: "Fetch package information for all the new tools and SDK versions"
default: false
Expand Down
Loading

0 comments on commit 7488110

Please sign in to comment.