-
Notifications
You must be signed in to change notification settings - Fork 41
Cache more in CI #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Cache more in CI #112
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1879ddf
Use rust-toolchain.toml in js-compute-runtime
jameysharp e550721
Cache Rust dependencies of js-compute-runtime
jameysharp 72baffa
Use rust-toolchain.toml at top-level
jameysharp 3b51646
Share runner's $HOME with Centos container
jameysharp b8fbe99
Cache builds on `main` and pull requests
jameysharp 34f5669
Quote all variable substitutions in run-linux script
jameysharp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| #!/bin/sh | ||
| #!/usr/bin/env bash | ||
|
|
||
| exec docker exec --env PREBUILT_ENGINE=${PREBUILT_ENGINE:-} -w $PWD -i centos "$@" | ||
| set -euo pipefail | ||
| exec docker run -i \ | ||
| --env PREBUILT_ENGINE=$PREBUILT_ENGINE \ | ||
| --env PATH="/opt/rh/devtoolset-8/root/usr/bin:$PATH" \ | ||
| -v $HOME:$HOME --workdir $PWD \ | ||
| binary-compatible-builds "$@" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ jobs: | |
| path: | | ||
| c-dependencies/spidermonkey/${{ matrix.profile }} | ||
| key: cache-${{ hashFiles('c-dependencies/spidermonkey/build-engine.sh') }}-${{ hashFiles('c-dependencies/spidermonkey/gecko-revision') }}-${{ hashFiles('c-dependencies/spidermonkey/object-files.list') }}-${{ matrix.profile }} | ||
| if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | ||
|
|
||
| - name: "Build SpiderMonkey" | ||
| if: steps.sm-cache.outputs.cache-hit != 'true' | ||
|
|
@@ -46,12 +47,10 @@ jobs: | |
| sudo mkdir -p /opt/wasi-sdk | ||
| sudo mv wasi-sdk-12.0/* /opt/wasi-sdk/ | ||
|
|
||
| - name: "Install pinned Rust version and wasm32-wasi target" | ||
| - name: "Install pinned Rust version" | ||
| run: | | ||
| rustup set profile minimal | ||
| rustup update 1.57.0 --no-self-update | ||
| rustup default 1.57.0 | ||
| rustup target add wasm32-wasi | ||
| cd c-dependencies/js-compute-runtime | ||
| rustup show | ||
|
|
||
| - name: "Install Binaryen (linux)" | ||
| run: | | ||
|
|
@@ -60,24 +59,24 @@ jobs: | |
| curl -sS -L "https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/binaryen-version_${BINARYEN_VERSION}-x86_64-linux.tar.gz" | tar xzf - && | ||
| echo "$PWD/binaryen-version_${BINARYEN_VERSION}/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Cache Rust dependencies | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.cargo/bin/ | ||
| ~/.cargo/registry/index/ | ||
| ~/.cargo/registry/cache/ | ||
| ~/.cargo/git/db/ | ||
| c-dependencies/js-compute-runtime/rusturl | ||
| key: ${{ runner.os }}-cargo-${{ hashFiles('c-dependencies/js-compute-runtime/**/Cargo.*') }} | ||
elliottt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | ||
|
|
||
| - name: "Build JS runtime (debug)" | ||
| run: | | ||
| set -x | ||
| mkdir dist | ||
| cd dist | ||
| DEBUG=1 CXX_OPT="-O1" make -f ../c-dependencies/js-compute-runtime/Makefile | ||
| rm *.{d,o} | ||
| cd .. | ||
| run: DEBUG=1 CXX_OPT="-O1" make -C c-dependencies/js-compute-runtime DESTDIR=$PWD install | ||
| if: matrix.profile == 'debug' | ||
|
|
||
| - name: "Build JS runtime (release)" | ||
| run: | | ||
| set -x | ||
| mkdir dist | ||
| cd dist | ||
| make -f ../c-dependencies/js-compute-runtime/Makefile | ||
| rm *.{d,o} | ||
| cd .. | ||
| run: make -C c-dependencies/js-compute-runtime DESTDIR=$PWD install | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎉 |
||
| if: matrix.profile == 'release' | ||
|
|
||
| - uses: actions/upload-artifact@v1 | ||
|
|
@@ -204,7 +203,7 @@ jobs: | |
| ~/.cargo/git/db/ | ||
| target/ | ||
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
| if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/v') | ||
| if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | ||
|
|
||
| # Build `js-compute-runtime` | ||
| - run: PREBUILT_ENGINE=engine-release/js-compute-runtime.wasm $CENTOS cargo build --release | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [toolchain] | ||
| # we're stuck on 1.57 until we can upgrade past wasi-sdk-12 | ||
| channel = "1.57.0" | ||
| targets = [ "wasm32-wasi" ] | ||
| profile = "minimal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [toolchain] | ||
| channel = "stable" | ||
| profile = "minimal" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.