deps: toolchain upgrade #179
Workflow file for this run
This file contains 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
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
defaults: | |
run: | |
shell: bash | |
# Cancel any in-flight jobs for the same PR/branch so there's only one active | |
# at a time | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install Rust | |
run: rustup update stable --no-self-update && rustup default stable | |
- name: Install wasm32-unknown-unknown target | |
run: rustup target add wasm32-unknown-unknown | |
- name: Install wasm32-wasi target | |
run: rustup target add wasm32-wasi | |
# - run: | | |
# curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sdk-16.0-linux.tar.gz -L | tar xzvf - | |
# echo "WASI_SDK_PATH=`pwd`/wasi-sdk-16.0" >> $GITHUB_ENV | |
# if : matrix.os == 'ubuntu-latest' | |
# - run: | | |
# curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sdk-16.0-macos.tar.gz -L | tar xzvf - | |
# echo "WASI_SDK_PATH=`pwd`/wasi-sdk-16.0" >> $GITHUB_ENV | |
# if : matrix.os == 'macos-latest' | |
# - run: | | |
# curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sdk-16.0-mingw.tar.gz -L | tar xzvf - | |
# echo "WASI_SDK_PATH=`pwd`/wasi-sdk-16.0" >> $GITHUB_ENV | |
# if : matrix.os == 'windows-latest' | |
- name: "Install Binaryen (linux)" | |
run: | | |
set -x | |
export BINARYEN_VERSION=105 | |
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: "Install wasi-sdk-20 (linux)" | |
run: | | |
set -x | |
curl -sS -L -O https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz | |
tar xf wasi-sdk-20.0-linux.tar.gz | |
sudo mkdir -p /opt/wasi-sdk | |
sudo mv wasi-sdk-20.0/* /opt/wasi-sdk/ | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Cache wasm-tools | |
id: wasm-tools-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/.cargo/bin/wasm-tools | |
key: crate-cache-wasm-tools | |
- name: "Install wasm-tools" | |
if: steps.wasm-tools-cache.outputs.cache-hit != 'true' | |
run: cargo install wasm-tools | |
- name: gecko-dev hash | |
id: gecko-dev-hash | |
run: cd deps/js-compute-runtime/runtime/spidermonkey/gecko-dev && echo "GECKO_DEV_HASH=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" | |
shell: bash | |
- name: Cache Spidermonkey | |
uses: actions/cache@v3 | |
id: sm-cache | |
with: | |
path: deps/js-compute-runtime/runtime/spidermonkey/release | |
key: cache-${{ hashFiles( | |
'deps/js-compute-runtime/runtime/spidermonkey/build-engine.sh', | |
'deps/js-compute-runtime/runtime/spidermonkey/object-files.list' | |
) }}-${{ steps.gecko-dev-hash.outputs.GECKO_DEV_HASH }} | |
- name: js-compute-runtime hash | |
id: js-compute-runtime-hash | |
run: cd deps/js-compute-runtime/runtime/js-compute-runtime && echo "JS_COMPUTE_RUNTIME_HASH=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" | |
shell: bash | |
- name: Cache js-compute-runtime | |
uses: actions/cache@v3 | |
id: js-compute-runtime | |
with: | |
path: deps/js-compute-runtime/runtime/js-compute-runtime/build | |
key: cache-${{ steps.js-compute-runtime-hash.outputs.GECKO_DEV_HASH }}-${{ steps.js-compute-runtime-hash.outputs.JS_COMPUTE_RUNTIME_HASH }} | |
- name: Cache Rust dependencies | |
uses: actions/cache@v3 | |
id: rust-build | |
with: | |
path: target | |
key: engine-build-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} | |
- name: Install NPM packages | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm run test | |
- name: Cache Example build | |
uses: actions/cache@v3 | |
with: | |
path: example/target | |
key: engine-cargo-${{ hashFiles('example/src/main.rs', 'example/Cargo.lock', 'example/hello.wit') }} | |
- name: Test Example | |
run: cd example && npm run build && ./test.sh | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust | |
run: rustup update stable && rustup default stable && rustup component add rustfmt | |
- name: Format source code | |
run: cargo fmt -- --check |