Move package test running to test script#70
Open
graeme wants to merge 7 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a local scripts/test helper to run Swift Package tests for both the root package (“BrewKit”) and Tools/BrewUILint, then wires those same package tests into the pr_build_test GitHub Actions workflow to keep local and CI test execution aligned.
Changes:
- Add
scripts/testto runxcrun swift testfor the root package andTools/BrewUILint. - Update
pr_build_testCI to run both SwiftPM test suites, cache.buildoutputs, and upload SwiftPM test logs on failure. - Document
scripts/testusage expectations for agents inAGENTS.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
scripts/test |
New local helper script to run SwiftPM tests for both packages. |
AGENTS.md |
Documents when to run scripts/test for local/CI parity. |
.github/workflows/pr_build_test.yml |
Adds SwiftPM test steps + caches + failure log uploads, and broadens workflow path filters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: .build | ||
| key: ${{ runner.os }}-brewkit-${{ hashFiles('Package.swift', 'Package.resolved') }} |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: Tools/BrewUILint/.build | ||
| key: ${{ runner.os }}-brewuilint-${{ hashFiles('Tools/BrewUILint/Package.swift', 'Tools/BrewUILint/Package.resolved', 'Tools/BrewUILint/Sources/**', 'Tools/BrewUILint/Plugins/**') }} |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The .build caches keyed only on package manifests with bare restore-keys prefixes, so a runner-image Xcode/Swift bump could restore artifacts built by a different compiler. Add a swift --version fingerprint to each cache key and restore-keys prefix so the cache busts on a real toolchain change while staying warm across ordinary source edits. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR: Add
scripts/testand run Swift package tests in CISummary
Adds a
scripts/testhelper that runs the Swift Package tests for both packages —BrewKit(rootPackage.swift) andBrewUILint(Tools/BrewUILint/Package.swift) — and wires those same tests into thepr_build_testCI workflow so local runs and CI stay in parity.Changes
CI (
.github/workflows/pr_build_test.yml)Sources/**,Tests/**,Package.swift, andTools/BrewUILint/**.swift teststeps for theBrewKitandBrewUILintpackages, each with a.buildcache keyed on its package manifests/sources.swift-test-brewkit.logandswift-test-brewuilint.log.Tooling (
scripts/test)swift testfor both packages and mirrors the CI steps, so green locally means green on CI.Docs (
AGENTS.md)scripts/testand when agents should run it: before any commit, and before reporting a code-changing turn complete when Swift sources, package manifests, or the CI workflow changed.Testing
scripts/testruns and exits 0 (BrewKit + BrewUILint package tests pass locally).PR checklist
scripts/testlocally.