Skip to content

Remove cargo-wasi from GitHub tests #159

Remove cargo-wasi from GitHub tests

Remove cargo-wasi from GitHub tests #159

Workflow file for this run

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' || '' }}${{ matrix.features != 'default' && format(', {0}', matrix.features) || '' }})
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
features:
- default
- unnamed-tmpfile
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build and Test
run: |
export TEST_DIR=$RUNNER_TEMP
cargo test --target ${{ matrix.target }} --features ${{ matrix.features }} --release --verbose
- name: Lint
run: |
cargo clippy --all-targets -- --deny=warnings
cargo fmt --check
cargo-test-linux-overlayfs:
name: Build and Test (Linux, overlayfs)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-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@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build and Test
run: |
export TEST_DIR=$RUNNER_TEMP
cargo test --release --verbose
- name: Lint
run: |
cargo clippy --all-targets -- --deny=warnings
cargo fmt --check
cargo-test-windows:
name: Build and Test (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build and Test
run: |
set TEST_DIR=%RUNNER_TEMP%
cargo test --release --verbose
- name: Lint
run: |
cargo clippy --all-targets -- --deny=warnings
cargo fmt --check
cross-test:
name: Build and Test (${{ matrix.target }}, using cross-compilation)
runs-on: ubuntu-latest
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- arm-linux-androideabi
- arm-unknown-linux-gnueabi
- arm-unknown-linux-gnueabihf
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- armv5te-unknown-linux-gnueabi
- armv5te-unknown-linux-musleabi
- armv7-linux-androideabi
- armv7-unknown-linux-gnueabi
- armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabi
- armv7-unknown-linux-musleabihf
- i586-unknown-linux-gnu
- i586-unknown-linux-musl
- i686-unknown-linux-gnu
- powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- s390x-unknown-linux-gnu
- sparc64-unknown-linux-gnu
- thumbv7neon-linux-androideabi
- thumbv7neon-unknown-linux-gnueabihf
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cross
run: |
cargo install --locked cross
- name: Test
run: |
cross test --target=${{ matrix.target }} --release --verbose
cross-build:
name: Build (${{ matrix.target }}, using cross-compilation)
runs-on: ubuntu-latest
strategy:
matrix:
target:
- i686-linux-android
- i686-pc-windows-gnu
- i686-unknown-freebsd
- sparcv9-sun-solaris
- x86_64-linux-android
- x86_64-pc-windows-gnu
- x86_64-unknown-freebsd
- x86_64-unknown-freebsd
- x86_64-unknown-illumos
- x86_64-unknown-illumos
- x86_64-unknown-netbsd
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cross
run: |
cargo install --locked cross
- name: Build
run: |
cross build --target=${{ matrix.target }} --release --verbose
cargo-test-all-features:
name: Build and Test (all features combinations)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-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
lint-crash-tests:
name: Lint Crash Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Lint
run: |
cd crash-tests/linux
cargo clippy --all-targets -- --deny=warnings
cargo fmt --check