|
| 1 | +# ******************************************************************************* |
| 2 | +# Copyright (c) 2025 Contributors to the Eclipse Foundation |
| 3 | +# |
| 4 | +# See the NOTICE file(s) distributed with this work for additional |
| 5 | +# information regarding copyright ownership. |
| 6 | +# |
| 7 | +# This program and the accompanying materials are made available under the |
| 8 | +# terms of the Apache License Version 2.0 which is available at |
| 9 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# SPDX-License-Identifier: Apache-2.0 |
| 12 | +# ******************************************************************************* |
| 13 | + |
| 14 | +name: cargo build, test, coverage and miri report |
| 15 | + |
| 16 | +on: |
| 17 | + push: |
| 18 | + branches: [main, development] |
| 19 | + pull_request: |
| 20 | + branches: [main, development] |
| 21 | + types: [opened, ready_for_review, reopened, synchronize] |
| 22 | + |
| 23 | +env: |
| 24 | + CARGO_TERM_COLOR: always |
| 25 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + |
| 27 | +jobs: |
| 28 | + cargo-checks: |
| 29 | + #permissions for docs deployment |
| 30 | + permissions: |
| 31 | + contents: write |
| 32 | + pages: write |
| 33 | + id-token: write |
| 34 | + runs-on: ${{ vars.REPO_RUNNER_LABELS && fromJSON(vars.REPO_RUNNER_LABELS) || 'ubuntu-latest' }} |
| 35 | + timeout-minutes: 45 # minutes is the maximum allowed for a cold run |
| 36 | + steps: |
| 37 | + - name: Checkout Repository |
| 38 | + uses: actions/checkout@v4 |
| 39 | + |
| 40 | + - name: Setup Rust Build Environment |
| 41 | + uses: ./.github/actions/setup-rust-build |
| 42 | + with: |
| 43 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + |
| 45 | + # ---------- BUILD ---------- |
| 46 | + - name: Cargo build |
| 47 | + run: cargo build --verbose |
| 48 | + |
| 49 | + # ---------- TARPAULIN(TEST + COVERAGE) ---------- |
| 50 | + - name: Run tests under coverage |
| 51 | + run: cargo +nightly tarpaulin --version 0.32.7 --skip-clean --out Html --verbose --no-dead-code --engine llvm --all-features |
| 52 | + |
| 53 | + - name: Upload coverage report |
| 54 | + uses: actions/upload-artifact@v4 |
| 55 | + with: |
| 56 | + name: coverage-report |
| 57 | + path: tarpaulin-report.html |
| 58 | + |
| 59 | + # ---------- MIRI ---------- |
| 60 | + - name: Install nightly + miri (minimal profile) |
| 61 | + uses: actions-rs/toolchain@v1 |
| 62 | + if: github.event.pull_request.draft == false |
| 63 | + with: |
| 64 | + toolchain: nightly-2025-05-30 |
| 65 | + profile: minimal |
| 66 | + components: miri |
| 67 | + override: true |
| 68 | + |
| 69 | + - name: Prefetch crates for nightly |
| 70 | + if: github.event.pull_request.draft == false |
| 71 | + run: cargo +nightly-2025-05-30 fetch --locked |
| 72 | + |
| 73 | + - name: Purge Miri artifacts |
| 74 | + if: github.event.pull_request.draft == false |
| 75 | + run: | |
| 76 | + rm -rf target/miri |
| 77 | + rm -rf ~/.cache/miri |
| 78 | +
|
| 79 | + - name: Prefetch and build dependencies for Miri |
| 80 | + if: github.event.pull_request.draft == false |
| 81 | + run: cargo +nightly-2025-05-30 miri setup |
| 82 | + |
| 83 | + - name: Run Miri and save report |
| 84 | + if: github.event.pull_request.draft == false |
| 85 | + env: |
| 86 | + CARGO_INCREMENTAL: "0" # turn off incremental |
| 87 | + run: | |
| 88 | + set -o pipefail |
| 89 | + cargo +nightly-2025-05-30 miri test --workspace \ |
| 90 | + -- --skip test_mt_one_pop_one_stealer \ |
| 91 | + --skip test_mt_one_push_mpmc_one_stealer \ |
| 92 | + --skip test_one_producer_multi_stealer_mt_thread \ |
| 93 | + --skip test_one_producer_one_stealer_mt_thread \ |
| 94 | + 2>&1 | tee miri_report.txt |
0 commit comments