Skip to content

test: test commit

test: test commit #15

Workflow file for this run

name: vertx-vaadin validation
on:
push:
branches: [development]
workflow_dispatch:
pull_request_target:
types: [opened, synchronize, reopened, edited]
permissions:
contents: read
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
env:
JAVA_VERSION: 11
jobs:
check-permissions:
name: Check User Permissions
runs-on: ubuntu-latest
steps:
- run: echo "Concurrency Group = ${{ github.head_ref || github.ref_name }}"
- uses: actions-cool/check-user-permission@main
id: checkUser
with:
username: ${{github.triggering_actor}}
require: 'write'
- name: Fail on workflow triggered by external contributor
if: ${{ steps.checkUser.outputs.require-result != 'true' && github.actor != 'dependabot[bot]' && github.actor != 'vertx-vaadin-bot[bot]' }}
run: |
echo "🚫 **${{ github.actor }}** is an external contributor, a **${{ github.repository }}** team member has to review this changes and re-run this build" \
| tee -a $GITHUB_STEP_SUMMARY && exit 1
changes:
name: Compute changes
needs: [check-permissions]
runs-on: ubuntu-latest
outputs:
validation-required: ${{ steps.filter.outputs.validate }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
validate:
- '!(README.md|LICENSE|.gitignore|tools/**)'
build:
name: Build
needs: [changes]
if: ${{ needs.changes.outputs.validation-required == 'true' }}
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
cache: maven
- uses: browser-actions/setup-chrome@latest
id: setup-chrome
if: ${{ !vars.QH_DISABLE_CHROME_INSTALL }}
with:
chrome-version: stable
- name: Build
run: |
set -x -e -o pipefail
VERTX_VAADIN_VERSION=$(mvn -N -ntp -q help:evaluate -Dexpression=project.version -DforceStdout)
echo "VERTX_VAADIN_VERSION=${VERTX_VAADIN_VERSION}" >> "$GITHUB_ENV"
mvn -V -e -B -ntp -DskipTests -DskipVertxRun=true install -Pflow-ui-tests
- name: Save workspace
run: |
tar cf workspace.tar -C ~/ $(cd ~/ && echo .m2/repository/com/github/mcollovati/vertx/**/$VERTX_VAADIN_VERSION)
tar rf workspace.tar $(find . -d -name target)
- uses: actions/upload-artifact@v3
with:
name: saved-workspace
path: workspace.tar
tests:
name: Tests
needs: [build]
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
cache: maven
- uses: browser-actions/setup-chrome@latest
id: setup-chrome
if: ${{ !vars.QH_DISABLE_CHROME_INSTALL }}
with:
chrome-version: stable
- uses: actions/download-artifact@v3
if: ${{ github.run_attempt == 1 }}
with:
name: saved-workspace
- name: Restore Workspace
if: ${{ github.run_attempt == 1 }}
run: |
set -x
tar xf workspace.tar
tar cf - .m2 | (cd ~ && tar xf -)
- name: Build
if: ${{ github.run_attempt > 1 }}
run: |
set -x -e -o pipefail
mvn -V -e -B -ntp -DskipTests -DskipVertxRun=true -Dmaven.javadoc.skip=false install -Pflow-ui-tests
- name: Test
env:
VAADIN_OFFLINE_KEY: ${{ secrets.VAADIN_OFFLINE_KEY }}
run: |
set -x -e -o pipefail
mvn -V -e -B -ntp verify -Dmaven.javadoc.skip=false -DtrimStackTrace=false
- name: Package test output files
if: ${{ failure() || success() }}
run: find . -name surefire-reports -o -name failsafe-reports | tar -czf tests-report-main.tgz -T -
- uses: actions/upload-artifact@v3
if: ${{ failure() || success() }}
with:
name: tests-output
path: tests-report-*.tgz
it-tests-1:
name: UI tests 1
needs: [build]
if: ${{ needs.changes.outputs.validation-required == 'true' }}
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
cache: maven
- uses: browser-actions/setup-chrome@latest
id: setup-chrome
if: ${{ !vars.QH_DISABLE_CHROME_INSTALL }}
with:
chrome-version: stable
- name: Set Chrome Version
run: |
CHROME_VERSION=$(google-chrome --version | sed 's/^Google Chrome //' | cut -d. -f1)
echo "CHROME_VERSION=${CHROME_VERSION}" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v3
if: ${{ github.run_attempt == 1 }}
with:
name: saved-workspace
- name: Restore Workspace
if: ${{ github.run_attempt == 1 }}
run: |
set -x
tar xf workspace.tar
tar cf - .m2 | (cd ~ && tar xf -)
- name: Build
if: ${{ github.run_attempt > 1 }}
run: |
set -x -e -o pipefail
mvn -V -e -B -ntp -DskipTests -DskipVertxRun=true -Dmaven.javadoc.skip=false install -Pflow-ui-tests
- name: UI Test
env:
VAADIN_OFFLINE_KEY: ${{ secrets.VAADIN_OFFLINE_KEY }}
run: |
set -x -e -o pipefail
cd vertx-vaadin-tests
mvn -V -e -B -ntp verify -Dmaven.javadoc.skip=false -pl=-:vite-basics,-:vite-production -DtrimStackTrace=false \
-Dwebdriver.chrome.driver=$(which chromedriver) \
-Duitest.chrome-version=$CHROME_VERSION \
-Dtest.vertx.jvmArgs="-Dorg.slf4j.simpleLogger.logFile=target/verticle.log -Dvaadin.require.home.node=true -Xmx2048M -Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.SLF4JLogDelegateFactory"
- name: Dump threads
if: ${{ cancelled() }}
run: |
for pid in $(jps | cut -d ' ' -f 1); do
echo
echo
echo "========================= BEGIN THREAD DUMP $pid"
jps -mlvV | grep "$pid " || echo ''
echo
jstack $pid || echo "No dump for $pid"
echo "========================= END THREAD DUMP $pid"
echo
echo
done
- name: Package test output files
#if: ${{ failure() || success() }}
if: ${{ always() }}
run: find . -name surefire-reports -o -name failsafe-reports -o -name verticle.log | tar -czf tests-report-it-1.tgz -T -
- uses: actions/upload-artifact@v3
#if: ${{ failure() || success() }}
if: ${{ always() }}
with:
name: tests-output
path: tests-report-*.tgz
it-tests-2:
name: UI tests 2
needs: [build]
if: ${{ needs.changes.outputs.validation-required == 'true' }}
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
cache: maven
- uses: browser-actions/setup-chrome@latest
id: setup-chrome
if: ${{ !vars.QH_DISABLE_CHROME_INSTALL }}
with:
chrome-version: stable
- uses: actions/download-artifact@v3
if: ${{ github.run_attempt == 1 }}
with:
name: saved-workspace
- name: Restore Workspace
if: ${{ github.run_attempt == 1 }}
run: |
set -x
tar xf workspace.tar
tar cf - .m2 | (cd ~ && tar xf -)
- name: Build
if: ${{ github.run_attempt > 1 }}
run: |
set -x -e -o pipefail
mvn -V -e -B -ntp -DskipTests -Dmaven.javadoc.skip=false install -Pflow-ui-tests
- name: UI Test
env:
VAADIN_OFFLINE_KEY: ${{ secrets.VAADIN_OFFLINE_KEY }}
run: |
set -x -e -o pipefail
cd vertx-vaadin-tests/test-frontend
mvn -V -e -B -ntp verify -Dmaven.javadoc.skip=false -DtrimStackTrace=false \
-Dtest.vertx.jvmArgs='-Dorg.slf4j.simpleLogger.logFile=target/verticle.log -Dvaadin.require.home.node=true -Xmx2048M -Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.SLF4JLogDelegateFactory' \
-Dwebdriver.chrome.driver=$(which chromedriver)
- name: Dump threads
if: ${{ cancelled() }}
run: |
for pid in $(jps | cut -d ' ' -f 1); do
echo
echo
echo "========================= BEGIN THREAD DUMP $pid"
jps -mlvV | grep "$pid " || echo ''
echo
jstack $pid || echo "No dump for $pid"
echo "========================= END THREAD DUMP $pid"
echo
echo
done
- name: Package test output files
#if: ${{ failure() || success() }}
if: ${{ always() }}
run: find . -name surefire-reports -o -name failsafe-reports -o -name verticle.log | tar -czf tests-report-it-2.tgz -T -
- uses: actions/upload-artifact@v3
#if: ${{ failure() || success() }}
if: ${{ always() }}
with:
name: tests-output
path: tests-report-*.tgz
test-results:
permissions:
issues: read
checks: write
pull-requests: write
if: ${{ always() }}
needs: [changes, tests, it-tests-1, it-tests-2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/download-artifact@v3
if: ${{ always() && needs.changes.outputs.validation-required == 'true' }}
with:
name: tests-output
- name: Extract downloaded files
if: ${{ always() && needs.changes.outputs.validation-required == 'true' }}
run: for i in *.tgz; do tar xvf $i; done
- name: Publish Unit Test Results
if: ${{ always() && needs.changes.outputs.validation-required == 'true' }}
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: "**/target/*-reports/TEST*.xml"
- name: Set Failure Status
if: ${{ always() && needs.changes.outputs.validation-required == 'true' && (needs.build-and-test.result != 'success' || needs.ui-tests.result != 'success') }}
run: |
echo "🚫 THERE ARE TEST MODULES WITH FAILURES or BEEN CANCELLED" | tee -a $GITHUB_STEP_SUMMARY
exit 1
- name: Set validation skipped status
if: ${{ always() && needs.changes.outputs.validation-required == 'false' }}
run: |
echo "✅ Pull request only contains changes on files ignored by validation workflow" | tee -a $GITHUB_STEP_SUMMARY && exit 0