Add crash tests for Linux #108
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: Cargo Test | |
on: | |
push: | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
cargo-test-linux: | |
name: Build and Test (Linux${{ contains(matrix.target, 'musl') && ', musl' || '' }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-unknown-linux-musl | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
- name: Build and Test | |
run: | | |
export TEST_DIR=$RUNNER_TEMP | |
cargo test --target ${{ matrix.target }} --release --verbose | |
- name: Lint | |
run: | | |
cargo clippy --all-targets | |
cargo fmt --check | |
cargo-test-linux-overlayfs: | |
name: Build and Test (Linux, overlayfs) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build and Test | |
run: | | |
mkdir $RUNNER_TEMP/lower | |
mkdir $RUNNER_TEMP/upper | |
mkdir $RUNNER_TEMP/work | |
mkdir $RUNNER_TEMP/merged | |
export TEST_DIR=$RUNNER_TEMP/merged | |
export TEST_DIR_SUPPORTS_UNNAMED=false | |
sudo mount -t overlay none -o lowerdir=$RUNNER_TEMP/lower,upperdir=$RUNNER_TEMP/upper,workdir=$RUNNER_TEMP/work $TEST_DIR | |
cargo test --release --verbose | |
cargo-test-macos: | |
name: Build and Test (MacOS) | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build and Test | |
run: | | |
export TEST_DIR=$RUNNER_TEMP | |
cargo test --release --verbose | |
- name: Lint | |
run: | | |
cargo clippy --all-targets | |
cargo fmt --check | |
cargo-test-windows: | |
name: Build and Test (Windows) | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build and Test | |
run: | | |
set TEST_DIR=%RUNNER_TEMP% | |
cargo test --release --verbose | |
- name: Lint | |
run: | | |
cargo clippy --all-targets | |
cargo fmt --check | |
cargo-test-wasi: | |
name: Build (wasi) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: wasm32-wasi | |
- uses: actions-rs/install@v0.1 | |
with: | |
crate: cargo-wasi | |
version: latest | |
- name: Build | |
run: | | |
cargo wasi build --release --verbose | |
- name: Lint | |
run: | | |
cargo clippy --all-targets | |
cargo fmt --check | |
cargo-test-all-features: | |
name: Build and Test (all features combinations) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
- name: Install cargo-all-features | |
run: | | |
cargo install --locked cargo-all-features | |
- name: Build and Test | |
run: | | |
export TEST_DIR=$RUNNER_TEMP | |
cargo +nightly test-all-features --release --verbose | |
- name: Lint | |
run: | | |
cargo +nightly check-all-features --all-targets |