Skip to content

Rust

Rust #552

Workflow file for this run

name: Rust
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
on:
pull_request:
branches: [ main ]
release:
types: [ created ]
repository_dispatch:
types: [ rust ]
workflow_dispatch:
jobs:
builder:
name: Build
strategy:
matrix:
platform: [ macos-latest, ubuntu-latest, windows-latest ]
toolchain: [ stable, nightly ]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: setup (langspace)
run: rustup default ${{ matrix.toolchain }} && rustup update
- name: Build
run: cargo build --all-features -r -v --workspace
- name: Cache build
id: cache-build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target/release
key: ${{ matrix.toolchain }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
test:
name: Test (features)
needs: [ builder ]
strategy:
matrix:
package: [ core ]
flags: [ --no-default-features, --all-features ]
toolchain: [ stable, nightly ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup default ${{ matrix.toolchain }} && rustup update
- name: Test (${{ matrix.package }})
run: cargo test ${{ matrix.flags }} -r -v --package ${{ matrix.package }}
workspace:
name: Workspace
needs: [ builder ]
strategy:
matrix:
toolchain: [ stable, nightly ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup default ${{ matrix.toolchain }} && rustup update
- name: Test
run: cargo test --all-features -r -v --workspace
- name: Bench
if: matrix.toolchain == 'nightly'
run: cargo bench --all-features -v --workspace