| 1 |
name: CI |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
- staging |
| 8 |
- trying |
| 9 |
pull_request: |
| 10 |
branches: |
| 11 |
- master |
| 12 |
|
| 13 |
env: |
| 14 |
CARGO_TERM_COLOR: always |
| 15 |
RUSTFLAGS: "--deny warnings" |
| 16 |
MSRV: 1.31.0 |
| 17 |
NO_STD_TARGET: thumbv6m-none-eabi |
| 18 |
|
| 19 |
jobs: |
| 20 |
test: |
| 21 |
strategy: |
| 22 |
matrix: |
| 23 |
rust: |
| 24 |
- stable |
| 25 |
- nightly |
| 26 |
os: |
| 27 |
- ubuntu-latest |
| 28 |
- macOS-latest |
| 29 |
- windows-latest |
| 30 |
runs-on: ${{ matrix.os }} |
| 31 |
steps: |
| 32 |
- uses: actions/checkout@v2 |
| 33 |
- uses: actions-rs/toolchain@v1 |
| 34 |
with: |
| 35 |
profile: minimal |
| 36 |
toolchain: ${{ matrix.rust }} |
| 37 |
override: true |
| 38 |
- name: Build |
| 39 |
run: cargo build --all --all-targets |
| 40 |
- name: Run tests |
| 41 |
run: | |
| 42 |
cargo test --all --all-targets |
| 43 |
cargo test --all --no-default-features |
| 44 |
|
| 45 |
no-std: |
| 46 |
runs-on: ubuntu-latest |
| 47 |
steps: |
| 48 |
- uses: actions/checkout@v2 |
| 49 |
- uses: actions-rs/toolchain@v1 |
| 50 |
with: |
| 51 |
profile: minimal |
| 52 |
toolchain: stable |
| 53 |
override: true |
| 54 |
target: ${{ env.NO_STD_TARGET }} |
| 55 |
- name: Build |
| 56 |
run: cargo build --verbose --no-default-features --target ${{ env.NO_STD_TARGET }} |
| 57 |
|
| 58 |
msrv: |
| 59 |
runs-on: ubuntu-latest |
| 60 |
steps: |
| 61 |
- uses: actions/checkout@v2 |
| 62 |
- uses: actions-rs/toolchain@v1 |
| 63 |
with: |
| 64 |
profile: minimal |
| 65 |
toolchain: ${{ env.MSRV }} |
| 66 |
override: true |
| 67 |
- name: Build |
| 68 |
run: cargo build --verbose |
| 69 |
|
| 70 |
lint: |
| 71 |
runs-on: ubuntu-latest |
| 72 |
steps: |
| 73 |
- uses: actions/checkout@v2 |
| 74 |
- uses: actions-rs/toolchain@v1 |
| 75 |
with: |
| 76 |
profile: minimal |
| 77 |
toolchain: stable |
| 78 |
override: true |
| 79 |
components: rustfmt |
| 80 |
- name: Check code formatting |
| 81 |
run: cargo fmt -- --check |