-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (91 loc) · 2.78 KB
/
run.yml
File metadata and controls
105 lines (91 loc) · 2.78 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: run
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "**" ]
# Concurrency control to cancel previous runs on new commits
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
java: [17]
os: [ubuntu-latest, ubuntu-22.04]
browser: [chrome]
fail-fast: false
env:
DISPLAY: ':99'
MAVEN_OPTS: '-Xmx2048m'
BROWSER: ${{ matrix.browser }}
steps:
- uses: actions/checkout@v4.1.7
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4.3.0
with:
java-version: '${{ matrix.java }}'
distribution: 'temurin'
cache: maven
- name: Cache Maven dependencies
uses: actions/cache@v4.2.3
with:
path: |
~/.m2/repository
~/.m2/wrapper
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Chrome
if: matrix.browser == 'chrome'
uses: browser-actions/setup-chrome@v1.7.2
with:
chrome-version: stable
- name: Start Xvfb
run: |
sudo Xvfb :99 -ac -screen 0 1280x1024x24 > /dev/null 2>&1 &
sleep 3
- name: Validate environment
run: |
echo "Java version:"
java -version
echo "Maven version:"
mvn -version
echo "Browser: ${{ matrix.browser }}"
if [ "${{ matrix.browser }}" = "chrome" ]; then
echo "Chrome version:"
google-chrome --version
fi
echo "Display: $DISPLAY"
- name: Test
run: mvn clean install -P headless-github -B -T 1C -Dbrowser=${{ matrix.browser }}
continue-on-error: false
timeout-minutes: 20
- name: Upload test reports
uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: test-reports-java${{ matrix.java }}-${{ matrix.os }}-${{ matrix.browser }}
path: |
**/target/surefire-reports/
**/target/allure-results/
**/target/cucumber/
**/logs/
retention-days: 30
- name: Upload screenshots on failure
uses: actions/upload-artifact@v4.4.0
if: failure()
with:
name: screenshots-java${{ matrix.java }}-${{ matrix.os }}-${{ matrix.browser }}
path: |
**/target/screenshots/
**/target/test-output/
retention-days: 7
- name: Cleanup
if: always()
run: |
pkill -f Xvfb || true
pkill -f chrome || true