name: anes-rs test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: ${{matrix.rust}} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable, nightly]
include:
- rust: stable
can-fail: false
- rust: nightly
can-fail: true
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Rust
uses: hecrj/setup-rust-action@master
with:
rust-version: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Toolchain Information
run: |
rustc --version
rustfmt --version
rustup --version
cargo --version
- name: Check formatting
if: matrix.rust == 'stable'
run: cargo fmt --all -- --check
- name: Lint the code
if: matrix.rust == 'stable'
run: cargo clippy
- name: Test build
run: cargo build
continue-on-error: ${{ matrix.can-fail }}
- name: Test all features
run: cargo test --all-features -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test packaging
if: matrix.rust == 'stable'
run: cargo package
continue-on-error: ${{ matrix.can-fail }}