-
-
Notifications
You must be signed in to change notification settings - Fork 6
89 lines (85 loc) · 2.63 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:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
aem-maven-build:
name: Call workflow
uses: orbinson/workflows/.github/workflows/aem-maven-build.yml@main
with:
java-version: 21
sonar:
name: Run SonarQube analysis
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: maven
- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Execute SonarQube maven plugin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B -Pcoverage verify sonar:sonar
ui-tests:
name: Run UI tests
runs-on: ubuntu-latest
needs: aem-maven-build
permissions:
contents: write
packages: read
pull-requests: write
services:
aem-author:
image: ghcr.io/orbinson/aem-sdk:author-2024.10.18459.20241031T210302Z-241000
ports:
- 4502:4502
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: maven
- name: Get Playwright version from package-lock.json
run: echo "PLAYWRIGHT_VERSION=$(jq -r '.packages["node_modules/playwright-core"].version' ui.tests/package-lock.json)" >> $GITHUB_ENV
- name: Cache Playwright binaries
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install all package
run: mvn install -B -U -PautoInstallSinglePackage
- name: Install it.content package
run: mvn install -B -U -PautoInstallPackage -pl it.content
- name: Run ui.tests
run: mvn test -B -pl ui.tests -DskipTests=false
- name: Publish Playwright test results
run: |
npx github-actions-ctrf --pull-request --annotate --on-fail-only ui.tests/ctrf/ctrf-report.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Playwright HTML report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: ui.tests/playwright-report