Merge pull request #7 from avsaase/fix-no-std #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} | |
jobs: | |
ci: | |
needs: clippy_fmt | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
rust: [stable] | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
features: [--features default, --no-default-features --features no_std] | |
include: | |
- {rust: nightly, os: ubuntu-latest, features: --features default} | |
- {rust: nightly, os: ubuntu-latest, features: --no-default-features --features no_std} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust ${{ matrix.rust }} | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- name: Build project | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: ${{ matrix.features }} | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
if: ${{ matrix.features == '--features default' }} | |
with: | |
command: test | |
args: --all | |
clippy_fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Check formatting | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Run Clippy for linting | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- -D warnings --no-deps |