-
Notifications
You must be signed in to change notification settings - Fork 3
Add CI to style and audit the tap #10
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
4 commits
Select commit
Hold shift + click to select a range
6ac42ca
Add CI to style and audit the tap
joe4dev 1c472b2
Authenticate the online audit and always run the formula checks
joe4dev b549005
Run the formula audit even when its style check fails
joe4dev 745328b
Point the formula TODO at the upstream fix and trim its comment
joe4dev 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: Tap CI | ||
|
|
||
| # Content reaches this tap two ways -- release bots push generated files to | ||
| # main, and people hand-edit them (#8) -- and neither is checked today. The | ||
| # deprecated `postflight` stanza (#7) shipped that way and survived two | ||
| # releases. | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| audit: | ||
| name: Style and audit | ||
| # Casks are macOS artifacts, and the runner ships Homebrew. | ||
| runs-on: macos-latest | ||
| timeout-minutes: 20 | ||
| # `brew audit --online` queries the GitHub API, and the runners share IPs | ||
| # that are already over the unauthenticated rate limit. | ||
| env: | ||
| HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Check out the tap | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| path: tap | ||
|
|
||
| # Audit and the cask cops both resolve a tap name, not a path, so the | ||
| # checkout has to stand in as the real tap. | ||
| - name: Install the checkout as localstack/tap | ||
| run: | | ||
| dest="$(brew --repository)/Library/Taps/localstack/homebrew-tap" | ||
| mkdir -p "$(dirname "${dest}")" | ||
| rm -rf "${dest}" | ||
| cp -R tap "${dest}" | ||
|
|
||
| # TODO(localstack/lstk#512): drop --except-cops. The next lstk release | ||
| # regenerates this cask with the quarantine stanza first, which trips | ||
| # Cask/StanzaOrder on every stanza after it until the install_steps form | ||
| # lands upstream. Scoped to that one cop, so Cask/InstallSteps -- the cop | ||
| # that catches #7 -- still fires. | ||
| - name: Style the cask | ||
| run: brew style --except-cops=Cask/StanzaOrder --cask localstack/tap/lstk | ||
|
|
||
| # Why this job earns its keep: --online fetches every url and verifies | ||
| # every checksum. lstk's own CI renders the cask before the release it | ||
| # points at exists, so it cannot check either. | ||
| - name: Audit the cask | ||
| run: brew audit --cask --online localstack/tap/lstk | ||
|
|
||
| # TODO(localstack/localstack-cli#57): drop continue-on-error once a release | ||
| # regenerates the formula from that fix. Reported not enforced until then: | ||
| # the generator emits 7 problems, and fixing them here would be overwritten. | ||
| # | ||
| # `always()` so a failing cask check above does not skip this; `|| rc=1` | ||
| # because `-e` would otherwise abort before the audit. | ||
| - name: Style and audit the formula | ||
| if: always() | ||
| continue-on-error: true | ||
| run: | | ||
| rc=0 | ||
| brew style --formula localstack/tap/localstack-cli || rc=1 | ||
| brew audit --formula --online localstack/tap/localstack-cli || rc=1 | ||
| exit "${rc}" | ||
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.
when do we change this to false? localstack/localstack-cli#57 is already approved. So the plan is to release that #57 first, then make this CI step blocking?
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.
I created a personal reminder to follow up once a new localstack-cli release ships. Refining the deprecation warning would be such a change that triggers a release.
I felt it wasn't worth triggering a dummy release.