|
| 1 | +name: Weekly beta compile test |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # New versions of rust release on Thursdays. We test on Mondays to get at least 3 days of warning before all our CI breaks again. |
| 6 | + # https://forge.rust-lang.org/release/process.html#release-day-thursday |
| 7 | + - cron: '0 12 * * 1' |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +env: |
| 11 | + CARGO_TERM_COLOR: always |
| 12 | + NIGHTLY_TOOLCHAIN: nightly |
| 13 | + |
| 14 | +jobs: |
| 15 | + test: |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: [windows-latest, ubuntu-latest, macos-latest] |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + timeout-minutes: 30 |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + - uses: dtolnay/rust-toolchain@beta |
| 24 | + - name: Install alsa and udev |
| 25 | + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev |
| 26 | + if: runner.os == 'linux' |
| 27 | + - name: Build & run tests |
| 28 | + # See tools/ci/src/main.rs for the commands this runs |
| 29 | + run: cargo run -p ci -- test |
| 30 | + env: |
| 31 | + CARGO_INCREMENTAL: 0 |
| 32 | + RUSTFLAGS: "-C debuginfo=0 -D warnings" |
| 33 | + |
| 34 | + lint: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + timeout-minutes: 30 |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - uses: dtolnay/rust-toolchain@beta |
| 40 | + with: |
| 41 | + components: rustfmt, clippy |
| 42 | + - name: Install alsa and udev |
| 43 | + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev |
| 44 | + - name: Run lints |
| 45 | + # See tools/ci/src/main.rs for the commands this runs |
| 46 | + run: cargo run -p ci -- lints |
| 47 | + |
| 48 | + check-compiles: |
| 49 | + runs-on: ubuntu-latest |
| 50 | + timeout-minutes: 30 |
| 51 | + needs: ci |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + - uses: dtolnay/rust-toolchain@beta |
| 55 | + - name: Install alsa and udev |
| 56 | + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev |
| 57 | + - name: Check compile test |
| 58 | + # See tools/ci/src/main.rs for the commands this runs |
| 59 | + run: cargo run -p ci -- compile |
| 60 | + |
| 61 | + check-doc: |
| 62 | + runs-on: ubuntu-latest |
| 63 | + timeout-minutes: 30 |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v4 |
| 66 | + - uses: dtolnay/rust-toolchain@beta |
| 67 | + - name: Install alsa and udev |
| 68 | + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev |
| 69 | + - name: Build and check docs |
| 70 | + # See tools/ci/src/main.rs for the commands this runs |
| 71 | + run: cargo run -p ci -- doc |
| 72 | + env: |
| 73 | + CARGO_INCREMENTAL: 0 |
| 74 | + RUSTFLAGS: "-C debuginfo=0" |
| 75 | + |
| 76 | + open-issue: |
| 77 | + name: Warn that weekly CI fails |
| 78 | + runs-on: ubuntu-latest |
| 79 | + needs: [test, lint, check-compiles, check-doc] |
| 80 | + permissions: |
| 81 | + issues: write |
| 82 | + # Use always() so the job doesn't get canceled if any other jobs fail |
| 83 | + if: ${{ always() && contains(needs.*.result, 'failure') }} |
| 84 | + steps: |
| 85 | + - name: Create issue |
| 86 | + run: | |
| 87 | + previous_issue_number=$(gh issue list \ |
| 88 | + --search "$TITLE in:title" \ |
| 89 | + --json number \ |
| 90 | + --jq '.[0].number') |
| 91 | + if [[ -n $previous_issue_number ]]; then |
| 92 | + gh issue comment $previous_issue_number \ |
| 93 | + --body "Weekly pipeline still fails: $FAILED_RUN" |
| 94 | + else |
| 95 | + gh issue create \ |
| 96 | + --title "$TITLE" \ |
| 97 | + --label "$LABELS" \ |
| 98 | + --body "$BODY" |
| 99 | + fi |
| 100 | + env: |
| 101 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 102 | + GH_REPO: ${{ github.repository }} |
| 103 | + TITLE: Main branch fails to compile on Rust beta. |
| 104 | + LABELS: C-Bug,S-Needs-Triage |
| 105 | + FAILED_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 106 | + BODY: | |
| 107 | + ## Weekly CI run has failed. |
| 108 | + [The offending run.]($FAILED_RUN) |
0 commit comments