Skip to content

Commit

Permalink
fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
mymindstorm committed Mar 6, 2020
1 parent 6f533eb commit b6b33c4
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 3,400 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,15 @@ jobs:

- name: Verify
run: emsdk list
tot:
runs-on: ubuntu-latest
steps:
- 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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: mymindstorm/setup-emsdk@v2
- uses: mymindstorm/setup-emsdk@v4

- name: Verify
run: emcc -v
Expand All @@ -22,7 +22,7 @@ jobs:
```yaml
- name: Cache emsdk
uses: actions/cache@v1
uses: actions/cache@v4
id: cache # This is important!
with:
# Set to the same folder as actions-cache-folder (more below)
Expand Down Expand Up @@ -62,6 +62,9 @@ no-cache:
actions-cache-folder:
description: "Set to the folder where your cached emsdk-master folder is or where emsdk cache will be copied to on sucessful run. This folder will go under $GITHUB_HOME (I.e. build dir)."
default: ''
update-tags:
description: "Update tags before installing a version"
default: false
```
See [action.yml](action.yml)
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: "Set to the folder where your cached emsdk-master folder is or where emsdk cache will be copied to on sucessful run. This folder will go under $GITHUB_HOME (I.e. build dir)."
default: ''
update-tags:
description: "Update tags before installing a version"
default: false
runs:
using: 'node12'
main: 'lib/main.js'
Expand Down
22 changes: 0 additions & 22 deletions docs/contributors.md

This file was deleted.

8 changes: 6 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function run() {
version: yield core.getInput("version"),
noInstall: yield core.getInput("no-install"),
noCache: yield core.getInput("no-cache"),
actionsCacheFolder: yield core.getInput("actions-cache-folder")
actionsCacheFolder: yield core.getInput("actions-cache-folder"),
updateTags: yield core.getInput("update-tags")
};
let emsdkFolder;
let foundInCache = false;
Expand Down Expand Up @@ -70,8 +71,11 @@ function run() {
return;
}
if (!foundInCache) {
if (emArgs.updateTags) {
yield exec.exec(`${emsdk} update-tags`);
}
yield exec.exec(`${emsdk} install ${emArgs.version}`);
if (emArgs.version !== "latest" && emArgs.noCache === "false") {
if (emArgs.version !== "latest" && emArgs.version !== "tot" && emArgs.noCache === "false") {
yield tc.cacheDir(emsdkFolder, 'emsdk', emArgs.version, os.arch());
}
}
Expand Down
Loading

0 comments on commit b6b33c4

Please sign in to comment.