name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable, beta, nightly]
features: [""]
include:
- os: ubuntu-latest
rust: nightly
features: "--features=nightly"
- os: windows-latest
rust: nightly
features: "--features=nightly"
- os: macOS-latest
rust: nightly
features: "--features=nightly"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: build
uses: actions-rs/cargo@v1
with:
command: build
args: "--verbose --no-default-features ${{ matrix.features }}"
- name: test --tests
uses: actions-rs/cargo@v1
with:
command: test
args: "--verbose --tests --no-default-features ${{ matrix.features }}"
- name: test --doc
uses: actions-rs/cargo@v1
with:
command: test
args: "--verbose --doc --no-default-features ${{ matrix.features }}"
- name: doc
uses: actions-rs/cargo@v1
with:
command: doc
args: "--verbose --no-default-features ${{ matrix.features }}"
- name: test --docsrs
uses: actions-rs/cargo@v1
with:
command: test
args: "--verbose --doc"
env:
RUSTFLAGS: "--cfg docsrs"
RUSTDOCFLAGS: "--cfg docsrs"
if: "${{ matrix.features == '--features=nightly' }}"
- name: --docsrs
uses: actions-rs/cargo@v1
with:
command: doc
args: "--verbose"
env:
RUSTFLAGS: "--cfg docsrs"
RUSTDOCFLAGS: "--cfg docsrs"
if: "${{ matrix.features == '--features=nightly' }}"
- name: build --release
uses: actions-rs/cargo@v1
with:
command: build
args: "--verbose --release --no-default-features ${{ matrix.features }}"