feat: add compile time composite key #1235
Workflow file for this run
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
name: WASM CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_REGISTRIES_MY_REGISTRY_INDEX: https://github.com/rust-lang/crates.io-index | |
BUCKET_NAME: tonbo-test | |
jobs: | |
check: | |
name: Rust project wasm check | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }} | |
cache-on-failure: false | |
- name: Run cargo clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
- name: configure aws credentials | |
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || startsWith(github.ref, 'refs/tags/') }} | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ env.ROLE_TO_ASSUME }} | |
role-session-name: samplerolesession | |
aws-region: ${{ env.AWS_REGION }} | |
env: | |
AWS_REGION: ap-southeast-1 | |
ROLE_TO_ASSUME: arn:aws:iam::232814779190:role/github | |
- name: Setup for wasm32 | |
run: | | |
rustup target add wasm32-unknown-unknown | |
- name: Run cargo build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --target wasm32-unknown-unknown --no-default-features --features bytes,wasm | |
- name: Install Chrome Environment | |
run: | | |
mkdir -p /tmp/chrome | |
wget $(curl https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq -r '.versions | sort_by(.version) | reverse | .[0] | .downloads.chrome | .[] | select(.platform == "linux64") | .url') | |
wget $(curl https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq -r '.versions | sort_by(.version) | reverse | .[0] | .downloads.chromedriver | .[] | select(.platform == "linux64") | .url') | |
unzip chromedriver-linux64.zip | |
unzip chrome-linux64.zip | |
cp -r chrome-linux64/ /tmp/chrome/ | |
cp -r chromedriver-linux64 /tmp/chrome/chromedriver | |
- name: Setup wasm-pack | |
run: | | |
cargo install wasm-pack | |
- name: Run wasm-pack test | |
env: | |
BUCKET_NAME: tonbo-test | |
run: | | |
echo "bucket: $BUCKET_NAME" | |
export PATH=$PATH:/tmp/chrome/chrome-linux64/:/tmp/chrome/chromedriver-linux64/ | |
wasm-pack test --chrome --headless --test wasm --no-default-features --features bytes,wasm,wasm-http |