Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
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

Copy link
Copy Markdown

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?

Copy link
Copy Markdown
Member Author

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.

run: |
rc=0
brew style --formula localstack/tap/localstack-cli || rc=1
brew audit --formula --online localstack/tap/localstack-cli || rc=1
exit "${rc}"
Loading