name: CI
on:
push:
branches:
- master
pull_request:
jobs:
check:
name: Check beta stable and MSRV
runs-on: ubuntu-latest
strategy:
matrix:
rust-toolchains:
- 1.65.0 - stable
- beta
feature--alloc-or-std: ['', '--features alloc', '--features std']
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust-toolchains }}
override: true
- name: Clone repo
uses: actions/checkout@v2
- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: |
--tests
--no-default-features
${{ matrix.feature--alloc-or-std }}
build-and-test:
name: Build and test
runs-on: ${{ matrix.os }}
needs: [check]
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
rust-toolchains:
- 1.65.0
- stable
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
toolchain: ${{ matrix.rust-toolchains }}
- name: Clone repo
uses: actions/checkout@v2
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
test-nightly:
name: Test nightly
runs-on: ubuntu-latest
needs: [build-and-test]
strategy:
fail-fast: false
matrix:
feature--alloc-or-std: ['', '--features alloc', '--features std']
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Clone repo
uses: actions/checkout@v2
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: |
--doc
--no-default-features
--features docs
${{ matrix.feature--alloc-or-std }}
-- --nocapture
miri:
name: Test with miri
runs-on: [ubuntu-latest]
needs: [test-nightly]
strategy:
matrix:
feature--alloc: ['', '--features alloc']
steps:
- name: Clone repo
uses: actions/checkout@v2
- name: Test with miri
run: ./miri_test.sh --no-default-features ${{ matrix.feature--alloc }}
required-jobs:
name: 'All the required jobs'
needs:
- check
- build-and-test
- miri
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: 'Check success of the required jobs'
run: |
RESULT=$(echo "${{ join(needs.*.result, '') }}" | sed -e "s/success//g")
if [ -n "$RESULT" ]; then
echo "❌"
false
fi
echo "✅"