File: ci.yml

package info (click to toggle)
rust-unsend 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 348 kB
  • sloc: python: 37; makefile: 2
file content (98 lines) | stat: -rw-r--r-- 2,898 bytes parent folder | download
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI

on:
  pull_request:
  push:
    branches:
      - main
  schedule:
    - cron: '0 2 * * 0'

env:
  CARGO_INCREMENTAL: 0
  CARGO_NET_RETRY: 10
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  RUSTFLAGS: -D warnings
  RUSTDOCFLAGS: -D warnings
  RUSTUP_MAX_RETRIES: 10

defaults:
  run:
    shell: bash

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]
        rust: [nightly, beta, stable]
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust
        run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
      - run: cargo build --all --all-features --all-targets
      - name: Run cargo check (without dev-dependencies to catch missing feature flags)
        if: startsWith(matrix.rust, 'nightly')
        run: cargo check -Z features=dev_dep
      - run: cargo test --all
      - run: cargo test --no-default-features --tests
      - run: cargo test --no-default-features --features alloc --tests
      - run: cargo test --no-default-features --features executor --tests
      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack
      - run: rustup target add thumbv7m-none-eabi
      - run: cargo hack build --target thumbv7m-none-eabi --no-default-features --no-dev-deps
      - run: cargo hack build --target thumbv7m-none-eabi --no-default-features --no-dev-deps --features alloc

  msrv:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        # When updating this, the reminder to update the minimum supported
        # Rust version in Cargo.toml.
        rust: ['1.48']
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust
        run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
      - run: cargo build
      - run: cargo build --no-default-features

  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust
        run: rustup update stable
      - run: cargo clippy --all --all-features --all-targets

  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Rust
        run: rustup update stable
      - run: cargo fmt --all --check

  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 --all
        env:
          MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation
          RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout

  security_audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      # https://github.com/rustsec/audit-check/issues/2
      - uses: rustsec/audit-check@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}