Nightly Dependency Update #8
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 Dependency Update | |
| # Rebuilds the crate against the latest compatible versions of its dependencies | |
| # (`cargo update`) every night. Because several dependencies are intentionally | |
| # unbounded (e.g. `windows = ">=0.61"`, `libc = ">=0.2.123"`), a newly published | |
| # version may break compilation; this job surfaces that early by opening an issue. | |
| on: | |
| schedule: | |
| # One hour after the regular nightly build so they don't run at once. | |
| - cron: "0 3 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| test: | |
| name: Test (updated deps) | |
| runs-on: ${{ matrix.os || 'ubuntu-latest' }} | |
| # Resolve to the absolute latest dependency versions, ignoring the crate's | |
| # rust-version (MSRV). Edition 2024 uses the MSRV-aware resolver (v3), which | |
| # otherwise caps `cargo update` at "latest 1.85-compatible" versions and | |
| # defeats the point of this job (it would never see a newer, breaking dep). | |
| env: | |
| CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: allow | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| name: | |
| - stable | |
| - beta | |
| - nightly | |
| - macOS | |
| - Windows | |
| include: | |
| - name: beta | |
| toolchain: beta | |
| - name: nightly | |
| toolchain: nightly | |
| - name: macOS | |
| os: macOS-latest | |
| - name: Windows | |
| os: windows-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Install toolchain | |
| id: tc | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.toolchain || 'stable' }} | |
| profile: minimal | |
| override: true | |
| # No build cache here on purpose: freshness is the whole point, a cached | |
| # target/ keyed on Cargo.toml could otherwise mask a newly published version. | |
| - name: Update dependencies to latest | |
| run: cargo update --verbose | |
| - name: Build all features | |
| if: matrix.features == '' | |
| run: cargo build --all-features | |
| - name: Test all features (other) | |
| if: matrix.features == '' && runner.os != 'Linux' | |
| run: cargo test --all-features -- --skip set_deadline_policy | |
| - name: Test all features (Linux) | |
| if: matrix.features == '' && runner.os == 'Linux' | |
| run: sudo -E /home/runner/.cargo/bin/cargo test --all-features | |
| report: | |
| name: Report failure | |
| needs: test | |
| if: failure() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Open or update tracking issue | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| run: | | |
| set -euo pipefail | |
| label="nightly-deps" | |
| # Make sure the label exists (no-op if it already does). | |
| gh label create "$label" --color B60205 \ | |
| --description "Nightly dependency-update build failures" || true | |
| body="The nightly job that runs \`cargo update\` and rebuilds against the latest compatible dependency versions has **failed**. | |
| This usually means a newly published version of an unbounded dependency (e.g. \`windows = \">=0.61\"\`, \`libc = \">=0.2.123\"\`) no longer compiles or passes the tests. Consider pinning an upper bound until it is resolved. | |
| Failed run: $RUN_URL" | |
| existing=$(gh issue list --state open --label "$label" --json number --jq '.[0].number // empty') | |
| if [ -n "$existing" ]; then | |
| gh issue comment "$existing" --body "Nightly dependency update failed again: $RUN_URL" | |
| else | |
| gh issue create \ | |
| --title "Nightly dependency update broke the build" \ | |
| --label "$label" \ | |
| --body "$body" | |
| fi |