Repository navigation
118 lines (99 loc) · 3.71 KB
/
Copy pathselenium-boot.yml
File metadata and controls
118 lines (99 loc) · 3.71 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
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Selenium Boot CI
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
workflow_dispatch:
permissions:
checks: write
contents: read
jobs:
# ── Job 1: Framework unit tests ──────────────────────────────────────────────
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout framework
uses: actions/checkout@v7
- name: Set up Java 17
uses: actions/setup-java@v6
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Run unit tests
run: mvn test --no-transfer-progress
- name: Upload surefire reports
if: always()
uses: actions/upload-artifact@v7
with:
name: unit-test-results
path: target/surefire-reports/
if-no-files-found: ignore
retention-days: 14
- name: Publish unit test results
if: always()
uses: dorny/test-reporter@v1
with:
name: Unit Test Results
path: '**/surefire-reports/TEST-*.xml'
reporter: java-junit
fail-on-error: false
fail-on-empty: false
# ── Job 2: Consumer integration tests ────────────────────────────────────────
integration-tests:
name: Consumer Integration Tests
runs-on: ubuntu-latest
needs: unit-tests
steps:
- name: Checkout framework
uses: actions/checkout@v7
- name: Set up Java 17
uses: actions/setup-java@v6
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Install framework to local Maven repo
run: mvn install -DskipTests -Dgpg.skip=true --no-transfer-progress
- name: Get framework version
id: version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "value=$VERSION" >> $GITHUB_OUTPUT
- name: Checkout consumer test project
uses: actions/checkout@v7
with:
repository: seleniumboot/selenium-boot-test
path: selenium-boot-test
- name: Pin consumer project to current framework version
run: |
sed -i "s|<artifactId>selenium-boot</artifactId>.*|<artifactId>selenium-boot</artifactId>|" selenium-boot-test/pom.xml
sed -i "/<artifactId>selenium-boot<\/artifactId>/{n;s|<version>.*</version>|<version>${{ steps.version.outputs.value }}</version>|}" selenium-boot-test/pom.xml
- name: Run API integration tests (no browser)
run: |
cd selenium-boot-test
# -DskipITs skips the JUnit 5 (Failsafe) tests, which open a real browser.
# Without it, -Dtest only filters Surefire, so the browser-based JUnit 5
# tests still run and flake on the CI renderer ("Timed out … renderer").
mvn test -Dtest="ApiDemoTest,ApiSchemaDemoTest" -DskipITs --no-transfer-progress
env:
CI: true
- name: Upload consumer test reports
if: always()
uses: actions/upload-artifact@v7
with:
name: consumer-test-results
path: selenium-boot-test/target/surefire-reports/
if-no-files-found: ignore
retention-days: 14
- name: Publish consumer test results
if: always()
uses: dorny/test-reporter@v1
with:
name: Consumer Integration Test Results
path: 'selenium-boot-test/**/surefire-reports/TEST-*.xml'
reporter: java-junit
fail-on-error: false
fail-on-empty: false