name: Rust - Continuous Integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
check:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Build (default features)
uses: dtolnay/rust-toolchain@stable
with:
command: build
args: --workspace
- name: Build (all features)
uses: dtolnay/rust-toolchain@stable
with:
command: build
args: --workspace --all-features
- name: Build wasmi itself as no_std
uses: dtolnay/rust-toolchain@stable
with:
command: build
args: --workspace --lib --no-default-features --target thumbv7em-none-eabi --exclude wasmi_cli
- name: Build (wasm32)
uses: dtolnay/rust-toolchain@stable
with:
command: build
args: --workspace --no-default-features --target wasm32-unknown-unknown
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Configure Pagefile for Windows
if: matrix.os == 'windows-2019'
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 6GB
maximum-size: 32GB
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Test (default features)
uses: dtolnay/rust-toolchain@stable
env:
RUSTFLAGS: '--cfg debug_assertions'
with:
command: test
args: --workspace --release
- name: Test (all features)
uses: dtolnay/rust-toolchain@stable
env:
RUSTFLAGS: '--cfg debug_assertions'
TEST_FLAGS: ${{ matrix.test-args }}
with:
command: test
args: --workspace --release --all-features -- $TEST_FLAGS
fmt:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- uses: dtolnay/rust-toolchain@stable
with:
command: fmt
args: --all -- --check
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rust-docs, rust-src
- uses: dtolnay/rust-toolchain@stable
env:
RUSTDOCFLAGS: '-D warnings'
with:
command: doc
args: --workspace --all-features --no-deps --document-private-items
audit:
name: Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable
with:
command: audit
args: ''
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: nightly
override: true
components: clippy
- name: Clippy (default features)
uses: dtolnay/rust-toolchain@stable
with:
command: clippy
args: --workspace -- -D warnings
- name: Clippy (all features)
uses: dtolnay/rust-toolchain@stable
with:
command: clippy
args: --workspace --all-features -- -D warnings
- name: Clippy (no_std)
uses: dtolnay/rust-toolchain@stable
with:
command: clippy
args: --workspace --no-default-features -- -D warnings