-
-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (78 loc) · 2.91 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Build
on:
schedule:
- cron: "2 4 * * *"
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
MAVEN_ARGS: "--no-transfer-progress --errors --fail-at-end --show-version"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 # required browsers are installed below
jobs:
build:
name: build and analyse
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: '21'
cache: 'maven'
- name: Build
run: ./mvnw -Pcoverage dependency:go-offline clean verify -Dgroups="!ui"
- name: Analyse with SonarCloud
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') }}
run: >
./mvnw
-Pcoverage
sonar:sonar
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.organization=urlaubsverwaltung
-Dsonar.projectKey=urlaubsverwaltung_zeiterfassung
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml
-Dsonar.javascript.lcov.reportPaths=target/js-coverage/lcov.info
-Dsonar.javascript.exclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js
-Dsonar.eslint.reportPaths=target/js-eslint/report.json
-Dsonar.coverage.exclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.js,**/*.test.js
-Dsonar.sources=src/main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
ui-test:
name: UI Test
runs-on: ubuntu-24.04
strategy:
matrix:
browser: ["chromium", "firefox", "webkit"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-ui-test-${{ matrix.browser }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: 21
cache: 'maven'
- name: Install Playwright Browsers (UI tests)
run: ./mvnw exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.classpathScope="test" -D exec.args="install --with-deps ${{matrix.browser}}"
- name: Test
run: ./mvnw dependency:go-offline clean verify -Pui-test -Dbrowser=${{matrix.browser}}
- name: Upload artifacts of failed tests
uses: actions/upload-artifact@v4
if: ${{ hashFiles('target/ui-test/**/FAILED-*') != '' }}
with:
name: failed-ui-tests
path: target/ui-test/**/FAILED-*