-
Notifications
You must be signed in to change notification settings - Fork 76
25.1 workflows #9066
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
Open
manolo
wants to merge
10
commits into
25.1
Choose a base branch
from
25.1-workflows
base: 25.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+216
−4
Open
25.1 workflows #9066
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fe53361
fix: fix local build issues with Flow frontend build
manolo 7bc3262
chore: add -B -ntp to the run.js script
manolo f7e03fe
feat: add GitHub Actions validation workflow
manolo dc4c8ad
chore: update GH Actions to Node 24 compatible versions
manolo b881780
chore: enable Maven quiet mode by default in validation workflow
manolo a6cf1ae
feat: publish test results to PR via check runs
manolo 46f85a2
fix: move MAVEN_ARGS to job-level env where runner context is available
manolo 09c3f12
feat: add merge queue support to validation workflow
manolo b4293f3
chore: remove sonar errors
manolo dc034ff
refactor: use GH Actions service container for Selenium
manolo 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,194 @@ | ||
| name: Validation | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ['main', '25.*'] | ||
| merge_group: | ||
| workflow_dispatch: | ||
| inputs: | ||
| components: | ||
| description: 'Space-separated component names (e.g. "grid combo-box"), empty for all' | ||
| required: false | ||
| default: '' | ||
|
|
||
| permissions: | ||
| contents: read | ||
| checks: write | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_ref || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| FORK_COUNT: 5 | ||
|
|
||
| jobs: | ||
| validation: | ||
| name: Build and Test | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 120 | ||
| services: | ||
| selenium: | ||
| image: selenium/standalone-chrome:latest | ||
| options: --shm-size=2g | ||
| ports: | ||
| - 4444:4444 | ||
| steps: | ||
| - name: Set Maven args | ||
| run: | | ||
| args="-ntp -B" | ||
| [ "${{ runner.debug }}" != "1" ] && args="$args -q" | ||
| echo "MAVEN_ARGS=$args" >> "$GITHUB_ENV" | ||
|
|
||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha || github.sha }} | ||
| fetch-depth: ${{ github.event_name == 'merge_group' && 50 || 1 }} | ||
|
|
||
| - name: Setup JDK 21 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '21' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
|
|
||
| - name: Setup Node 20 | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install TestBench license | ||
| if: env.TB_LICENSE != '' | ||
| env: | ||
| TB_LICENSE: ${{ secrets.TB_LICENSE }} | ||
| run: | | ||
| mkdir -p ~/.vaadin | ||
| user="${TB_LICENSE%%/*}" | ||
| key="${TB_LICENSE#*/}" | ||
| echo "{\"username\":\"${user}\",\"proKey\":\"${key}\"}" > ~/.vaadin/proKey | ||
|
|
||
| - name: Show environment info | ||
| run: | | ||
| java -version | ||
| mvn -version | ||
| node --version | ||
| npm --version | ||
|
|
||
| - name: Compile all sources | ||
| run: mvn clean test-compile -DskipFrontend $MAVEN_ARGS | ||
|
|
||
| - name: Unit tests and install | ||
| run: | | ||
| mvn install -Drelease -T $FORK_COUNT $MAVEN_ARGS || { | ||
| echo "::warning::First attempt failed (Maven multi-thread race). Retrying..." | ||
| sleep 15 | ||
| mvn install -Drelease -T $FORK_COUNT $MAVEN_ARGS | ||
| } | ||
|
|
||
| - name: Check for skip-ci | ||
| id: skip-ci | ||
| if: github.event_name == 'pull_request' || github.event_name == 'merge_group' | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| PR_TITLE: ${{ github.event.pull_request.title }} | ||
| run: | | ||
| if [ "${{ github.event_name }}" = "merge_group" ]; then | ||
| echo "skip=false" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| if echo "$PR_TITLE" | grep -q '\[skip ci\]'; then | ||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| pr_number="${{ github.event.pull_request.number }}" | ||
| commits=$(gh api "repos/${{ github.repository }}/pulls/$pr_number/commits" --jq '.[].commit.message') | ||
| if echo "$commits" | grep -q '\[skip ci\]'; then | ||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| echo "skip=false" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Detect modified components | ||
| id: components | ||
| if: steps.skip-ci.outputs.skip != 'true' | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| elements="${{ github.event.inputs.components || '' }}" | ||
| changed_files="" | ||
| if [ -z "$elements" ] && [ "${{ github.event_name }}" = "pull_request" ]; then | ||
| pr_number="${{ github.event.pull_request.number }}" | ||
| changed_files=$(gh api "repos/${{ github.repository }}/pulls/$pr_number/files" --jq '.[].filename') | ||
| elif [ -z "$elements" ] && [ "${{ github.event_name }}" = "merge_group" ]; then | ||
| changed_files=$(git diff --name-only "${{ github.event.merge_group.base_sha }}" "${{ github.event.merge_group.head_sha }}") | ||
| fi | ||
| if [ -n "$changed_files" ]; then | ||
| modified=$(echo "$changed_files" \ | ||
| | grep 'vaadin.*flow-parent' \ | ||
| | sed 's,^vaadin-\(.*\)-flow-parent.*,\1,' \ | ||
| | sort -u) | ||
| nmods=$(echo "$modified" | wc -w | tr -d ' ') | ||
| all_files=$(echo "$changed_files" | sort -u | tr -d '[:space:]') | ||
| component_files=$(echo "$changed_files" | grep 'vaadin.*flow-parent' | sort -u | tr -d '[:space:]') | ||
| if [ "$nmods" -lt 5 ] && [ ${#all_files} -eq ${#component_files} ]; then | ||
| elements=$(echo $modified | tr '\n' ' ') | ||
| echo "Running partial build for: $elements" | ||
| fi | ||
| fi | ||
| echo "elements=$elements" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: npm install | ||
| if: steps.skip-ci.outputs.skip != 'true' | ||
| run: npm install --ignore-scripts --silent --quiet --no-progress | ||
|
|
||
| - name: Merge ITs | ||
| if: steps.skip-ci.outputs.skip != 'true' | ||
| run: node scripts/mergeITs.js ${{ steps.components.outputs.elements }} | ||
|
|
||
| - name: Pre-compile merged ITs | ||
| if: steps.skip-ci.outputs.skip != 'true' | ||
| run: cd integration-tests && mvn compile test-compile $MAVEN_ARGS -DskipUnitTests | ||
|
|
||
| - name: WTR tests | ||
| if: steps.skip-ci.outputs.skip != 'true' | ||
| run: node scripts/wtr.js ${{ steps.components.outputs.elements }} | ||
|
|
||
| - name: Run integration tests | ||
| if: steps.skip-ci.outputs.skip != 'true' | ||
| env: | ||
| TBLICENSE: ${{ secrets.TB_LICENSE }} | ||
| run: | | ||
| args="$MAVEN_ARGS" | ||
| [ -n "$TBLICENSE" ] && args="$args -Dvaadin.testbench.developer.license=$TBLICENSE" | ||
| args="$args -Dtest.use.hub=true -Dcom.vaadin.testbench.Parameters.hubHostname=localhost -Dcom.vaadin.testbench.Parameters.hubPort=4444" | ||
| args="$args -Dfailsafe.rerunFailingTestsCount=2 -Dmaven.test.redirectTestOutputToFile=true" | ||
| mode="-Dfailsafe.forkCount=$FORK_COUNT -Dcom.vaadin.testbench.Parameters.testsInParallel=1" | ||
|
|
||
| mvn verify -Dvaadin.pnpm.enable -Drun-it -Drelease -Dvaadin.productionMode \ | ||
| -Dvaadin.force.production.build=true \ | ||
| $mode $args -pl integration-tests -DskipUnitTests | ||
|
|
||
| - name: Publish unit test results | ||
| if: always() | ||
| ## Make sonar happy for external actions | ||
| uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 | ||
| with: | ||
| name: Unit Tests | ||
| path: '**/target/surefire-reports/TEST-*.xml' | ||
| reporter: java-junit | ||
|
|
||
| - name: Publish integration test results | ||
| if: always() | ||
| uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 | ||
| with: | ||
| name: Integration Tests | ||
| path: 'integration-tests/target/failsafe-reports/TEST-*.xml' | ||
| reporter: java-junit | ||
|
|
||
| - name: Upload error screenshots | ||
| if: failure() | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: error-screenshots | ||
| path: 'integration-tests/error-screenshots/' | ||
| retention-days: 5 | ||
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
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
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
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
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.
It looks like this would only detect changed components when checking pull requests. It would be good to also have this for checks running from the merge queue.
Related to that, the workflow also needs the respective merge queue trigger.
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.
done