name: anes-rs test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: ${{ matrix.rust-toolchain }} on ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
rust-toolchain: [stable, nightly]
include:
- rust-toolchain: stable
can-fail: false
- rust-toolchain: nightly
can-fail: true
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust-toolchain }}
override: true
components: rustfmt, clippy
- name: Check formatting
uses: actions-rs/cargo@v1
continue-on-error: ${{ matrix.can-fail }}
with:
command: fmt
args: --all -- --check
- name: Lint the code
uses: actions-rs/cargo@v1
continue-on-error: ${{ matrix.can-fail }}
with:
command: clippy
args: -- -D warnings
- name: Test build
uses: actions-rs/cargo@v1
continue-on-error: ${{ matrix.can-fail }}
with:
command: build
- name: Test all features
uses: actions-rs/cargo@v1
continue-on-error: ${{ matrix.can-fail }}
with:
command: test
args: --all-features -- --nocapture
- name: Test publishing (dry run)
if: matrix.rust-toolchain == 'stable'
uses: actions-rs/cargo@v1
with:
command: publish
args: --dry-run