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
workflows/tests: run tap_syntax on stable brew
#166913
Conversation
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.
Love this.
Looking at CI times, |
Is it just: - key: style-cache-${{ github.sha }}
- restore-keys: style-cache-
+ key: style-cache-${{ matrix.branch }}-${{ github.sha }}
+ restore-keys: style-cache-${{ matrix.branch }}- |
Yes. First build will be slow since it'll be a new cache, but subsequent reruns should be quick again. |
484d835
to
1e1eb83
Compare
.github/workflows/tests.yml
Outdated
@@ -40,13 +43,14 @@ jobs: | |||
core: true | |||
cask: false | |||
test-bot: true | |||
stable: ${{ matrix.branch == 'stable' }} |
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 may need to adjust https://github.com/Homebrew/actions/blob/master/setup-homebrew/main.sh#L146 since we do have tags that aren't linked to master
branch.
EDIT: it does look like it got latest so may be okay?
==> Using Homebrew/brew 4.2.14 (test/utils/github_spec: filter further to fix test failure)
vs. master
==> Using Homebrew/brew 4.2.13-117-g999ecf8b54 (Merge pull request #16937 from Homebrew/ported-cmds)
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.
Yeah 4.2.14 is a special out-of-band release so master
being on 4.2.13 is intentional. Such scenarios are rare but we're in one such occurrence.
So that output is correct.
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 was wondering if might miss latest tag in current action since we do git fetch --force origin
rather than git fetch --force --tags origin
(like in brew
- https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cmd/update.sh#L63)
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.
Oh right, that's probably because it's prefetched in a Docker container:
linuxbrew@770efc9b046a:~/.linuxbrew/Homebrew$ git tag --list --sort="-version:refname" | head -n1
4.2.14
Your concern may however apply to macOS or bare Ubuntu: https://github.com/Bo98/workflow-test/actions/runs/8394589883/job/22992069978
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.
If there isn't much overhead, I can just add --tags
to existing command or just run git_retry -C "$HOMEBREW_REPOSITORY" fetch --force --tags origin
right before git tag
.
Another option I considered was brew update-reset "$HOMEBREW_REPOSITORY"
but didn't get chance to check on full impact of command.
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.
Adding --tags
to the existing command makes sense
Required check names need to be updated in repo settings. (Which also means all PRs need a rebase after this I think?) Alternatively if we want this to be less disruptive: we can maybe keep "tap_syntax (master)" as "tap_syntax". |
7c9d316
to
c46fa06
Compare
Signed-off-by: Michael Cho <[email protected]>
c46fa06
to
8bfe998
Compare
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.
Thanks again @cho-m, great idea!
Going to merge and try it out. I updated workflow to try to keep existing required Action should work in current state for One scenario that could happen is if we want to introduce a new tap-wide audit/style/syntax that is incompatible between stable and master. This could lead to We might have to bypass check and make sure to sync the merge of both PRs along with a new tagged release of For bypass, maybe something along lines of: --- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -30,6 +30,10 @@ jobs:
strategy:
matrix:
stable: [false, true]
+ new_syntax: contains(github.event.pull_request.labels.*.name, 'new syntax')
+ exclude:
+ - stable: true
+ new_syntax: true
name: tap_syntax${{ matrix.stable && ' (stable)' || '' }}
runs-on: ubuntu-22.04
container: |
It would probably make sense to disable elements on the stable check. For example, The label idea won't work as it'll affect every PR after merging. |
Label would require new tag after whatever breaking syntax change is introduced. But this could be some ongoing development work to a new If there is a lot of conditional differences, may be easier to split matrix to separate jobs and selectively tune each. If just an extra flag to |
|
Makes sense. Going to need changes in test-bot to tune this. This did work for my PR - https://github.com/Homebrew/homebrew-core/actions/runs/8402834719/job/23012649264?pr=166501#step:5:20
|
Agreed that ideally this would run |
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?