refactor: ci test suite for stable rust, nightly & beta toolchains
Diff
.github/workflows/devel.yml | 168 ++++++++++++++++++++++++++++++---------------
1 file changed, 114 insertions(+), 54 deletions(-)
@@ -1,73 +1,133 @@
name: devel
on:
pull_request:
push:
branches:
- 1.x
schedule:
- cron: '00 01 * * *'
jobs:
check:
name: Check
runs-on: ubuntu-latest
test:
name: test
runs-on: ${{ matrix.os }}
env:
CARGO: cargo
TARGET_FLAGS: ""
TARGET_DIR: ./target
RUST_BACKTRACE: 1
strategy:
matrix:
build:
- pinned
- stable
- beta
- linux-musl
- linux-musl-arm64
- linux-gnu
- linux-gnu-arm64
- linux-arm-gnueabihf
- macos
- macos-arm64
- windows-msvc
- windows-msvc-arm64
include:
- build: pinned
os: ubuntu-20.04
rust: 1.53.0
- build: stable
os: ubuntu-20.04
rust: stable
- build: beta
os: ubuntu-20.04
rust: beta
- build: linux-musl
os: ubuntu-20.04
rust: nightly
target: x86_64-unknown-linux-musl
- build: linux-musl-arm64
os: ubuntu-20.04
rust: nightly
target: aarch64-unknown-linux-musl
- build: linux-gnu
os: ubuntu-20.04
rust: nightly
target: x86_64-unknown-linux-gnu
- build: linux-gnu-arm64
os: ubuntu-20.04
rust: nightly
target: aarch64-unknown-linux-gnu
- build: linux-arm-gnueabihf
os: ubuntu-20.04
rust: nightly
target: arm-unknown-linux-gnueabihf
- build: macos
os: macos-latest
rust: nightly
target: x86_64-apple-darwin
- build: macos-arm64
os: macos-latest
rust: nightly
target: aarch64-apple-darwin
- build: windows-msvc
os: windows-2019
rust: nightly
target: x86_64-pc-windows-msvc
- build: windows-msvc-arm64
os: windows-2019
rust: nightly
target: aarch64-pc-windows-msvc
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Use Cross
if: matrix.target != ''
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Run tests
run: ${{ env.CARGO }} test --verbose
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build static-web-server and crates
run: ${{ env.CARGO }} build --verbose
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
checks:
name: checks
runs-on: ubuntu-20.04
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Check formatting
run: |
cargo fmt --all -- --check
- name: Run cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -D warnings
- name: Check via Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -D warnings