aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/rust.yml
blob: ed2b6ce7cb2f25a1ea4460f0cb23d4ee80056e8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Rust

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env:
  CARGO_TERM_COLOR: always

permissions: read-all

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust: [stable, beta, nightly]

    steps:
    - uses: actions/checkout@v3
    - name: Install Rust
      run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
    - name: Run Tests
      run: cargo test --verbose
    - run: cargo build --all --all-features --all-targets
    - name: Catch missing feature flags
      if: startsWith(matrix.rust, 'nightly')
      run: cargo check -Z features=dev_dep
    - name: Install cargo-hack
      uses: taiki-e/install-action@cargo-hack
    - run: rustup target add thumbv7m-none-eabi
    - name: Ensure we don't depend on libstd
      run: cargo hack build --target thumbv7m-none-eabi --no-dev-deps --no-default-features
  
  msrv:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version: [1.38.0]
    steps:
    - uses: actions/checkout@v3
    - name: Install Rust
      run: rustup update ${{ matrix.version }} && rustup default ${{ matrix.version }}
    - run: cargo build --all --all-features --all-targets

  miri:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Install Rust
      run: rustup toolchain install nightly --component miri && rustup default nightly
    - run: cargo miri test
      env:
        MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation -Zmiri-ignore-leaks
        RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout