186 lines
5.0 KiB
YAML
Raw Normal View History

2020-12-14 21:50:24 +00:00
name: Tests
on:
push:
branches: master
pull_request:
branches: master
schedule:
- cron: "0 12 * * 1"
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"
jobs:
check-doc:
name: Doc deadlinks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: cargo install cargo-deadlinks
- run: cargo deadlinks -- --features custom
main-tests:
name: Main tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: [nightly, beta, stable, 1.34]
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- run: cargo test
- run: cargo test --features std
- if: ${{ matrix.toolchain == 'nightly' }}
run: cargo build --benches
linux-tests:
name: Additional Linux targets
runs-on: ubuntu-latest
strategy:
matrix:
target: [
x86_64-unknown-linux-musl,
i686-unknown-linux-gnu,
i686-unknown-linux-musl,
]
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: ${{ matrix.target }}
toolchain: stable
override: true
# update is needed to fix the 404 error on install, see:
# https://github.com/actions/virtual-environments/issues/675
- run: sudo apt-get update
- run: sudo apt-get install gcc-multilib
2020-12-14 21:50:24 +00:00
- run: cargo test --target ${{ matrix.target }}
windows-tests:
name: Additional Windows targets
runs-on: windows-latest
strategy:
matrix:
toolchain: [
stable-x86_64-gnu,
stable-i686-gnu,
stable-i686-msvc,
]
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- run: cargo test
cross-tests:
name: Cross tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: mips-unknown-linux-gnu
toolchain: stable
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: ${{ matrix.target }}
toolchain: ${{ matrix.toolchain }}
override: true
- name: Cache cargo plugins
uses: actions/cache@v1
with:
path: ~/.cargo/bin/
key: ${{ runner.os }}-cargo-plugins
- name: Install cross
run: cargo install cross || true
- name: Test
run: cross test --no-fail-fast --target ${{ matrix.target }}
build:
name: Build-only
runs-on: ubuntu-latest
strategy:
matrix:
target: [
x86_64-sun-solaris,
x86_64-unknown-freebsd,
x86_64-fuchsia,
x86_64-unknown-netbsd,
x86_64-unknown-redox,
x86_64-fortanix-unknown-sgx,
]
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: ${{ matrix.target }}
toolchain: nightly
override: true
- name: Build
run: cargo build --target ${{ matrix.target }}
build-rdrand:
name: Build-only RDRAND
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rust-src
override: true
- name: UEFI
run: cargo build -Z build-std=core --features=rdrand --target=x86_64-unknown-uefi
2020-12-14 21:50:24 +00:00
- name: Hermit
run: cargo build -Z build-std=core --features=rdrand --target=x86_64-unknown-hermit
2020-12-14 21:50:24 +00:00
- name: L4Re
run: cargo build -Z build-std=core --features=rdrand --target=x86_64-unknown-l4re-uclibc
2020-12-14 21:50:24 +00:00
- name: VxWorks
run: cargo build -Z build-std=core --features=rdrand --target=x86_64-wrs-vxworks
2020-12-14 21:50:24 +00:00
clippy-fmt:
name: Clippy + rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
# https://github.com/rust-lang/rust-clippy/pull/6379 added MSRV
# support, so we need to use nightly until this is on stable.
toolchain: nightly
2020-12-14 21:50:24 +00:00
components: rustfmt, clippy
override: true
2020-12-14 21:50:24 +00:00
- name: clippy
run: cargo clippy --all
- name: fmt
run: cargo fmt --all -- --check