File: ci.yml

package info (click to toggle)
rust-async-task 4.7.1-4
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 368 kB
  • sloc: makefile: 2; sh: 1
file content (113 lines) | stat: -rw-r--r-- 3,608 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CI

permissions:
  contents: read

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

env:
  CARGO_INCREMENTAL: 0
  CARGO_NET_GIT_FETCH_WITH_CLI: true
  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@v4
      - name: Install Rust
        run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
      - run: rustup target add thumbv7m-none-eabi
      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack
      - name: Install valgrind
        uses: taiki-e/install-action@valgrind
      - run: cargo build --all --all-features --all-targets
        if: startsWith(matrix.rust, 'nightly')
      - run: cargo hack build --feature-powerset --no-dev-deps
      - run: cargo hack build --feature-powerset --no-dev-deps --target thumbv7m-none-eabi --skip std,default
      - run: cargo test
      - name: Run cargo test (with valgrind)
        run: cargo test -- --test-threads=1
        env:
          CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: valgrind -v --error-exitcode=1 --error-limit=no --leak-check=full --show-leak-kinds=all --track-origins=yes --fair-sched=yes
      - name: Run cargo test (with portable-atomic enabled)
        run: cargo test --features portable-atomic
      - name: Clone async-executor
        run: git clone https://github.com/smol-rs/async-executor.git
      - name: Add patch section
        run: |
          echo '[patch.crates-io]' >> async-executor/Cargo.toml
          echo 'async-task = { path = ".." }' >> async-executor/Cargo.toml
      - name: Test async-executor
        run: cargo test --manifest-path async-executor/Cargo.toml

  msrv:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack
      - run: cargo hack build --feature-powerset --no-dev-deps --rust-version

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

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

  miri:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust
        run: rustup toolchain install nightly --component miri && rustup default nightly
      - run: cargo miri test
        env:
          # -Zmiri-ignore-leaks is needed because we use detached threads in doctests: https://github.com/rust-lang/miri/issues/1371
          # disable preemption due to https://github.com/rust-lang/rust/issues/55005
          MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation -Zmiri-ignore-leaks -Zmiri-preemption-rate=0
          RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout

  security_audit:
    permissions:
      checks: write
      contents: read
      issues: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # https://github.com/rustsec/audit-check/issues/2
      - uses: rustsec/audit-check@master
        with:
          token: ${{ secrets.GITHUB_TOKEN }}