Rust #332
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: Rust | |
concurrency: | |
cancel-in-progress: false | |
group: ${{ github.event.repository.name }}-rust | |
env: | |
CARGO_TERM_COLOR: always | |
on: | |
push: | |
branches: [ main ] | |
tags: [ nightly*, v*.*.*] | |
release: | |
types: [ created ] | |
repository_dispatch: | |
types: [ rust ] | |
schedule: | |
- cron: 30 21 * * 0 # Every Sunday at 9:30PM UTC | |
workflow_dispatch: | |
permissions: write-all | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
platform: [ ubuntu-latest ] | |
target: [ wasm32-unknown-unknown, wasm32-wasi ] | |
toolchain: [ stable, nightly ] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup (langspace) | |
run: | | |
rustup update | |
rustup default ${{ matrix.toolchain }} | |
- name: Set target (${{ matrix.target }}) | |
if: matrix.toolchain == 'nightly' | |
run: rustup target add ${{ matrix.target }} | |
- name: Build | |
run: cargo build -r -v --workspace | |
- name: Cache build | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target/release | |
test: | |
name: Test | |
needs: build | |
strategy: | |
matrix: | |
platform: [ ubuntu-latest ] | |
target: [ wasm32-unknown-unknown, wasm32-wasi ] | |
toolchain: [ stable, nightly ] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup (langspace) | |
run: | | |
rustup update | |
rustup default ${{ matrix.toolchain }} | |
- name: Test | |
run: cargo test --all-features -r -v --workspace | |
benchmark: | |
name: Bench | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup (langspace) | |
run: | | |
rustup update | |
rustup default nightly | |
- name: Bench | |
run: cargo bench --features full -v --workspace |