-
Notifications
You must be signed in to change notification settings - Fork 9
perf(ci): make the nix dependency build reusable across revisions #1728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
53b172c
perf(nix): wrap the outputs that will be kept out of the shared cache
daniel-noland d548732
ci: reserve Cachix for reusable build inputs
daniel-noland 3b67b2a
ci: keep workspace outputs substitutable
daniel-noland 6b7c3a1
fix(nix): keep `results` out of the build source
daniel-noland 7666f92
perf(nix): share one dependency build per flag-set
daniel-noland 7424efd
perf(nix): remap sources to a relative prefix
daniel-noland 21604fb
ci: widen matrix parallelism for deep runs
daniel-noland 376472e
ci: honour ci:-vlab again
daniel-noland 5d693b0
ci: retry container pushes
daniel-noland 21ed20a
perf(nix): keep the git version out of the dependency build
daniel-noland 76fce62
ci: check that the dependency build stays reusable
daniel-noland 528c9df
ci: build clippy, doctests, and docs through nix
daniel-noland c74f7fb
perf(nix): lint the workspace in one derivation
daniel-noland c37b3e3
ci: give nix the whole core budget, and split it for test_each
daniel-noland 8323c59
ci: cut the coverage test floor and stop checking the fuzz profile twice
daniel-noland 23eeee1
docs(ci): document the ci:-vlab label
daniel-noland 9e1c795
ci: check that default.nix stays formatted
daniel-noland 23ea7cd
perf(nix): keep prose and dev config out of the build source
daniel-noland 368146d
ci: actually run nixfmt, and check that the lint lists agree
daniel-noland 96561e1
ci: keep every container image out of the shared cache
daniel-noland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,7 @@ jobs: | |
| runs-on: "ubuntu-latest" | ||
| outputs: | ||
| container_profiles: "${{ steps.container-profiles.outputs.value }}" | ||
| parallel: "${{ steps.parallel.outputs.value }}" | ||
| profiles: "${{ steps.profiles.outputs.value }}" | ||
| concurrency: "${{ steps.concurrency.outputs.value }}" | ||
| cross: "${{ steps.cross.outputs.value }}" | ||
|
|
@@ -81,6 +82,19 @@ jobs: | |
| with: | ||
| persist-credentials: "false" | ||
|
|
||
| # Let merge-gating runs finish quickly without allowing pull requests to | ||
| # crowd them out. `strategy` cannot read `env`, so expose this via `plan`. | ||
| - id: "parallel" | ||
| env: | ||
| EVENT: "${{ github.event_name }}" | ||
| run: | | ||
| set -euo pipefail | ||
| case "${EVENT}" in | ||
| merge_group | push) value="4" ;; | ||
| *) value="1" ;; | ||
| esac | ||
| printf 'value=%s\n' "${value}" >>"${GITHUB_OUTPUT}" | ||
|
|
||
| - id: "miri" | ||
| uses: &gate "./.github/actions/ci-gate" | ||
| with: | ||
|
|
@@ -183,10 +197,14 @@ jobs: | |
| JUST_VARS: "" | ||
| strategy: | ||
| fail-fast: false | ||
| # Keep one pull request from occupying the shared lab pool. | ||
| max-parallel: 1 | ||
| # Each entry gets its own runner; this limits shared-pool occupancy. | ||
| max-parallel: ${{ fromJSON(needs.plan.outputs.parallel) }} | ||
| matrix: | ||
| profile: "${{ fromJSON(needs.plan.outputs.profiles) }}" | ||
| exclude: | ||
| # Fuzz repeats the release compile here; coverage, sanitizers, and | ||
| # fuzzing jobs already exercise that profile. | ||
| - profile: "fuzz" | ||
| steps: | ||
| - *checkout | ||
|
|
||
|
|
@@ -219,6 +237,13 @@ jobs: | |
| recipe: "ci::check-doctest" | ||
| recipe_args: "${{ matrix.profile }}" | ||
|
|
||
| # Build API docs so links and cfg declarations cannot rot unnoticed. | ||
| - name: "docs" | ||
| uses: *just | ||
| with: | ||
| recipe: "ci::check-docs" | ||
| recipe_args: "${{ matrix.profile }}" | ||
|
|
||
| - &verify-clean-tree | ||
| name: "verify-clean-tree" | ||
| run: | | ||
|
|
@@ -319,6 +344,35 @@ jobs: | |
| with: | ||
| recipe: "markdownlint" | ||
|
|
||
| - name: "nixfmt" | ||
| id: "nixfmt" | ||
| continue-on-error: true | ||
| uses: *just | ||
| with: | ||
| recipe: "nixfmt" | ||
|
|
||
| - name: "check-lint-wiring" | ||
| id: "check-lint-wiring" | ||
| continue-on-error: true | ||
| uses: *just | ||
| with: | ||
| recipe: "check-lint-wiring" | ||
|
|
||
| - name: "check-push-filter" | ||
| id: "check-push-filter" | ||
| continue-on-error: true | ||
| uses: *just | ||
| with: | ||
| recipe: "check-push-filter" | ||
|
|
||
| # Cache misses still pass, so guard dependency reuse explicitly. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you fixed the commit message for |
||
| - name: "check-deps-reuse" | ||
| id: "check-deps-reuse" | ||
| continue-on-error: true | ||
| uses: *just | ||
| with: | ||
| recipe: "check-deps-reuse" | ||
|
|
||
| - name: "license-headers" | ||
| id: "license-headers" | ||
| continue-on-error: true | ||
|
|
@@ -337,6 +391,10 @@ jobs: | |
| pinact=${{ steps.pinact.outcome }} | ||
| actionlint=${{ steps.actionlint.outcome }} | ||
| markdownlint=${{ steps.markdownlint.outcome }} | ||
| nixfmt=${{ steps.nixfmt.outcome }} | ||
| check-lint-wiring=${{ steps.check-lint-wiring.outcome }} | ||
| check-push-filter=${{ steps.check-push-filter.outcome }} | ||
| check-deps-reuse=${{ steps.check-deps-reuse.outcome }} | ||
| license-headers=${{ steps.license-headers.outcome }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
@@ -365,7 +423,7 @@ jobs: | |
| env: *ci-env | ||
| strategy: | ||
| fail-fast: false | ||
| max-parallel: 1 | ||
| max-parallel: ${{ fromJSON(needs.plan.outputs.parallel) }} | ||
| matrix: | ||
| nix-target: | ||
| - frr.dataplane | ||
|
|
@@ -399,7 +457,7 @@ jobs: | |
| env: *ci-env | ||
| strategy: | ||
| fail-fast: false | ||
| max-parallel: 1 | ||
| max-parallel: ${{ fromJSON(needs.plan.outputs.parallel) }} | ||
| matrix: | ||
| sanitizer: | ||
| - thread | ||
|
|
@@ -444,7 +502,7 @@ jobs: | |
| env: *ci-env | ||
| strategy: | ||
| fail-fast: false | ||
| max-parallel: 1 | ||
| max-parallel: ${{ fromJSON(needs.plan.outputs.parallel) }} | ||
| # Fuzz provides optimized coverage while retaining safety checks. | ||
| matrix: | ||
| profile: "${{ fromJSON(needs.plan.outputs.profiles) }}" | ||
|
|
@@ -632,6 +690,7 @@ jobs: | |
| JUST_VARS: "" | ||
| strategy: | ||
| fail-fast: false | ||
| # Keep cross serial so one pull request cannot occupy the lab. | ||
| max-parallel: 1 | ||
| matrix: | ||
| platform: | ||
|
|
@@ -699,14 +758,16 @@ jobs: | |
| with: | ||
| # ci:+hlab is required to enable hybrid lab tests on PR | ||
| # ci:+vlab is required to enable virtual lab tests on PR | ||
| # ci:-vlab opts back out, including for ci:+merge-ready | ||
| # ci:-upgrade disables upgrade tests on PR | ||
| # hlab is disabled for main and merge_queue till we have gateway tests for it | ||
| # ci:+merge-ready mirrors the merge queue, which skips HLAB. | ||
| skip: >- | ||
| ${{ | ||
| github.event_name == 'pull_request' | ||
| && ( | ||
| matrix.hybrid && !contains(github.event.pull_request.labels.*.name, 'ci:+hlab') | ||
| contains(github.event.pull_request.labels.*.name, 'ci:-vlab') | ||
| || matrix.hybrid && !contains(github.event.pull_request.labels.*.name, 'ci:+hlab') | ||
| || !matrix.hybrid | ||
| && !contains(github.event.pull_request.labels.*.name, 'ci:+vlab') | ||
| && !contains(github.event.pull_request.labels.*.name, 'ci:+merge-ready') | ||
|
|
||
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The earlier likely nixfmt changes should probably be here in
ci: actually run nixfmt, and check that the lint lists agree