nightly #244
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: nightly | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| nightly-gatekeeper: | |
| runs-on: ubuntu-slim | |
| outputs: | |
| should_skip: ${{ steps.check.outputs.should_skip }} | |
| steps: | |
| - uses: actions/checkout@v6.0.3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for changes in last 24 hours | |
| id: check | |
| run: | | |
| # Check logs for commits in the last 24 hours on the current branch | |
| if [[ -z $(git log --since="24 hours ago" --pretty=format:"%H") ]]; then | |
| echo "No commits in the last 24 hours. Skipping..." | |
| echo "should_skip=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "New commits found. Proceeding..." | |
| echo "should_skip=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| mutation-testing: | |
| needs: [nightly-gatekeeper] | |
| if: ${{ needs.nightly-gatekeeper.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.3 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| enable-wild-linker: true | |
| rust-toolchain: RUST_NIGHTLY | |
| cargo-tools: CARGO_MUTANTS_VERSION | |
| # execute | |
| - name: Mutate All | |
| run: cargo +${{ env.RUST_NIGHTLY }} -Zscript scripts/mutants.rs | |
| miri-tree-borrows: | |
| needs: [nightly-gatekeeper] | |
| if: ${{ needs.nightly-gatekeeper.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| # Suppression file: .miri-tree-borrows-skip | |
| # | |
| # Miri's tree-borrows mode tracks per-byte aliasing provenance, | |
| # which can cause certain tests to exceed the runner's 16 GB memory | |
| # limit even though the allocations under test are small. Tests | |
| # listed in .miri-tree-borrows-skip (one fully-qualified path per | |
| # line, # comments for justification) are passed as --skip arguments | |
| # and reported as a ::warning annotation at the end of the run. | |
| # These tests are functionally correct and pass on 32+ GB machines. | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.3 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| rust-toolchain: RUST_NIGHTLY | |
| rust-components: miri | |
| # execute | |
| - name: Miri (tree borrows) | |
| env: | |
| MIRIFLAGS: -Zmiri-tree-borrows | |
| shell: pwsh | |
| run: | | |
| # Build --skip arguments from the suppression file. | |
| # See .miri-tree-borrows-skip for the list and justifications. | |
| $skipArgs = @() | |
| if (Test-Path .miri-tree-borrows-skip) { | |
| $skipArgs = @( | |
| Get-Content .miri-tree-borrows-skip | | |
| ForEach-Object { ($_ -replace '#.*').Trim() } | | |
| Where-Object { $_ -ne '' } | |
| ) | |
| } | |
| $skipFlags = @($skipArgs | ForEach-Object { "--skip"; $_ }) | |
| $cargoArgs = @( | |
| "+${{ env.RUST_NIGHTLY }}" | |
| "miri"; "test" | |
| "--all-features"; "--workspace"; "--lib"; "--tests" | |
| "--" | |
| ) + $skipFlags | |
| cargo @cargoArgs | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| # Report skipped tests clearly at the end | |
| if ($skipArgs.Count -gt 0) { | |
| Write-Host "" | |
| Write-Host "::warning::$($skipArgs.Count) test(s) skipped via .miri-tree-borrows-skip (tree-borrows provenance tracking exceeds runner memory):" | |
| $skipArgs | ForEach-Object { Write-Host " - $_" } | |
| } | |
| timeout-minutes: 240 | |
| miri-strict-provenance: | |
| needs: [nightly-gatekeeper] | |
| if: ${{ needs.nightly-gatekeeper.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.3 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| rust-toolchain: RUST_NIGHTLY | |
| rust-components: miri | |
| # execute | |
| - name: Miri (strict provenance) | |
| env: | |
| MIRIFLAGS: -Zmiri-strict-provenance | |
| run: cargo +${{ env.RUST_NIGHTLY }} miri test --all-features --workspace --lib --tests | |
| timeout-minutes: 240 | |
| miri-race-coverage: | |
| needs: [nightly-gatekeeper] | |
| if: ${{ needs.nightly-gatekeeper.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 720 # 12 hours, to accommodate the large number of seeds | |
| steps: | |
| # prep | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.3 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| enable-sccache: true | |
| rust-toolchain: RUST_NIGHTLY | |
| rust-components: miri | |
| - name: Setup Miri Flags | |
| # Rotate seed pairs daily based on day-of-month (1–31) to spread | |
| # coverage over time. -Zmiri-many-seeds uses an exclusive upper | |
| # bound, so we add 1: day 1 → seeds 1..3 (runs 1,2), day 2 → | |
| # seeds 3..5 (runs 3,4), …, day 31 → seeds 61..63 (runs 61,62). | |
| # Over a full month this covers seeds 1–62. | |
| shell: pwsh | |
| run: | | |
| $seedBase = [int](Get-Date -AsUtc -Format 'dd') | |
| $seedLow = 2 * $seedBase - 1 | |
| $seedHigh = 2 * $seedBase + 1 | |
| "MIRIFLAGS=-Zmiri-many-seeds=${seedLow}..${seedHigh}" >> $env:GITHUB_ENV | |
| # execute | |
| - name: Miri (race coverage) | |
| run: cargo +${{ env.RUST_NIGHTLY }} miri test --all-features --workspace --lib --tests | |
| timeout-minutes: 720 # 12 hours, to accommodate the large number of seeds | |
| report-failure: | |
| needs: | |
| - nightly-gatekeeper | |
| - mutation-testing | |
| - miri-tree-borrows | |
| - miri-strict-provenance | |
| - miri-race-coverage | |
| # `always()` ensures we still run when a dependency fails; the | |
| # gatekeeper guard skips the report on no-op nights. | |
| if: ${{ always() && needs.nightly-gatekeeper.outputs.should_skip != 'true' && contains(needs.*.result, 'failure') }} | |
| runs-on: ubuntu-slim | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Create or Update Issue on Failure | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| ISSUE_TITLE="🚨 Nightly Build Failed" | |
| ISSUE_DATE="$(date +'%Y-%m-%d')" | |
| ISSUE_FULL_TITLE="$ISSUE_TITLE: $ISSUE_DATE" | |
| ISSUE_BODY="The nightly scheduled build failed. Please check the logs here: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | |
| # Search for open issues with the same base title and label | |
| EXISTING_ISSUE=$(gh issue list --label "bug" --state open --search "$ISSUE_TITLE" --json number,title | jq -r '.[] | select(.title | startswith("'"$ISSUE_TITLE"'")) | .number' | head -n 1) | |
| if [[ -n "$EXISTING_ISSUE" ]]; then | |
| # Add a comment to the existing issue | |
| gh issue comment "$EXISTING_ISSUE" --body "$ISSUE_BODY" | |
| else | |
| # Create a new issue | |
| gh issue create \ | |
| --title "$ISSUE_FULL_TITLE" \ | |
| --body "$ISSUE_BODY" \ | |
| --label "bug" | |
| fi | |