name: CI
on:
push:
branches:
- master
pull_request:
jobs:
check:
name: Quick check in stable and MSRV
runs-on: ubuntu-latest
strategy:
matrix:
rust-toolchains:
- 1.65.0 - stable
features__proc-macros: ["", "--features proc-macros"]
features__showme: ["", "--features showme"]
exclude:
- rust-toolchains: 1.65.0
features__showme: "--features showme"
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: |
--no-default-features
${{ matrix.features__proc-macros }}
${{ matrix.features__showme }}
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
- nightly
exclude:
- os: windows-latest
rust-toolchains: 1.65.0
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 (nightly)
if: matrix.rust-toolchains == 'nightly'
uses: actions-rs/cargo@v1
with:
command: test
args: |
--doc
--no-default-features
--features proc-macros
--features nightly
-- --nocapture
- name: Cargo test
if: matrix.rust-toolchains != 'nightly'
uses: actions-rs/cargo@v1
with:
command: test
args: |
--doc
--no-default-features
--features proc-macros
-- --nocapture
required-jobs:
name: 'All the required jobs'
needs:
- check
- build-and-test
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 "✅"