-
Notifications
You must be signed in to change notification settings - Fork 874
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
CI pipeline improvements (more label control) #7206
Conversation
80b4e3a
to
7d4fdf3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
19a2a19
to
ccfd8da
Compare
.github/workflows/main.yml
Outdated
# 'git', 'subversion' and 'mercurial' labels trigger versioning job | ||
test_versioning: ${{ contains(github.event.pull_request.labels.*.name, 'git') || contains(github.event.pull_request.labels.*.name, 'subversion') || contains(github.event.pull_request.labels.*.name, 'mercurial') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} | ||
|
||
# 'Java EE/Jakarta EE', 'Micronaut' and 'enterprise' labels trigger enterprise job | ||
test_enterprise: ${{ contains(github.event.pull_request.labels.*.name, 'Java EE/Jakarta EE') || contains(github.event.pull_request.labels.*.name, 'Micronaut') || contains(github.event.pull_request.labels.*.name, 'enterprise') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} | ||
|
||
# 'JavaScript', 'TypeScript', 'HTML', 'CSS', 'CSL' and 'web' labels trigger enterprise job | ||
test_web: ${{ contains(github.event.pull_request.labels.*.name, 'JavaScript') || contains(github.event.pull_request.labels.*.name, 'TypeScript') || contains(github.event.pull_request.labels.*.name, 'HTML') || contains(github.event.pull_request.labels.*.name, 'CSS') || contains(github.event.pull_request.labels.*.name, 'CSL') || contains(github.event.pull_request.labels.*.name, 'web') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} | ||
|
||
# 'tests' label activates an extra step which builds all tests | ||
test_tests: ${{ contains(github.event.pull_request.labels.*.name, 'tests') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} |
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.
@sdedic since I believe you asked me about this before: this would change the enterprise job to be also opt-in. It listens to
enterprise
analog to the build-tools, web and versioning jobs
43e4c1a
to
0ce7358
Compare
- name: Check PR labels | ||
if: ${{ github.event_name == 'pull_request' && join(github.event.pull_request.labels.*.name) == '' }} | ||
run: | | ||
echo "::error::PRs must be labeled, see: https://cwiki.apache.org/confluence/display/NETBEANS/PRs+and+You+-+A+reviewer+Guide" | ||
exit 1 |
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.
this will fail when PRs are not labeled.
CI did always run some tests outside of the declared categories. The reasoning behind that was because I was worried about unlabeled PRs. Since this PR reduces the amount of testing outside of the declared labels, it will be enforced from now on (was discussed on apache slack with @neilcsmith-net ).
It should be easy to find labels even for trivial PRs, since we have enough labels which are generic and don't do anything. E.g
Editor
,
CI
The IDE cluster job is always enabled, one day we should make it also configurable but lets do this incrementally.
0ce7358
to
557ebb8
Compare
# 'LSP' label for enabling Language Server Protocol tests | ||
test_lsp: ${{ contains(github.event.pull_request.labels.*.name, 'LSP') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} | ||
# 'Gradle' or 'Maven' will activate lsp tests too due to test dependencies on project API (ProjectViewTest, LspBrokenReferencesImplTest, ...) | ||
test_lsp: ${{ contains(github.event.pull_request.labels.*.name, 'LSP') || contains(github.event.pull_request.labels.*.name, 'Gradle') || contains(github.event.pull_request.labels.*.name, 'Maven') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} |
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.
557ebb8
to
3ac180f
Compare
ran it once with all-all tests and it looks fine, CV on JDK 22 fails since it requires #7268 |
A few tweaks in anticipation to the policy changes: https://infra.apache.org/github-actions-policy.html restructuring: - more jobs are now opt-in and can be activated with labels (enterprise, db, javafx, profiler, versioning, web...) - moved web related steps into the webcommon job to shrink ide job - activate LSP tests also when 'Gradle' or 'Maven' label was set - matrix got further reduced for runs outside of PRs - combine some jobs into single build-system / misc job other changes: - fail CI if PR is not labeled - fixed issue where paperwork job couldn't be cancelled - bumped CV tests to JDK 22
3ac180f
to
f3fa61b
Compare
strategy: | ||
matrix: | ||
java: [ '17', '21', '22' ] | ||
exclude: | ||
- java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} |
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.
for future reference: this trick allows us to reduce the test matrix using labels or other properties
A few tweaks in anticipation to the policy changes:
https://infra.apache.org/github-actions-policy.html
restructuring:
refactored the env vars into 'outputs' of the base-build job since env vars can't be used everywhere but outputs can(enterprise, db, javafx, profiler, versioning, web...)
other changes:
full set of variables (or see labels with [ci] marker in their description):
netbeans/.github/workflows/main.yml
Lines 58 to 113 in 1a4519c