Skip to content

Commit f25d322

Browse files
authored
test: setup JDK matrix to test multiple popular versions (#408)
1 parent 3c76d58 commit f25d322

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

.github/workflows/tests.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,19 @@ on: push
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
java: [8, 11, 17]
811
timeout-minutes: 5
912
steps:
1013
- uses: actions/checkout@v4
14+
15+
- name: Set up JDK ${{ matrix.java }}
16+
uses: actions/setup-java@v3
17+
with:
18+
java-version: ${{ matrix.java }}
19+
distribution: "temurin"
20+
1121
- name: Cache npm dependencies
1222
uses: actions/cache@v3
1323
id: npm-cache
@@ -21,25 +31,22 @@ jobs:
2131
id: maven-cache
2232
with:
2333
path: ~/.m2/repository
24-
key: maven-cache-v1-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
34+
key: maven-cache-v1-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}-${{ matrix.java }}
2535
restore-keys: |
26-
maven-cache-v1-${{ runner.os }}-
27-
- name: Set up JDK 8
28-
uses: actions/setup-java@v3
29-
with:
30-
java-version: "8"
31-
distribution: "temurin"
36+
maven-cache-v1-${{ runner.os }}-${{ matrix.java }}
37+
3238
- name: Install Maven dependencies
3339
# https://github.com/actions/cache#skipping-steps-based-on-cache-hit
3440
if: steps.maven-cache.outputs.cache-hit != 'true'
3541
run: mvn clean install -DskipTests
42+
3643
- name: Install NPM dependencies
3744
# https://github.com/actions/cache#skipping-steps-based-on-cache-hit
3845
if: steps.npm-cache.outputs.cache-hit != 'true'
3946
run: |
40-
npm install &&
41-
npm --prefix=selenium install &&
42-
npm --prefix=playwright install
47+
npm ci &&
48+
npm --prefix=selenium ci &&
49+
npm --prefix=playwright ci
4350
4451
license-check:
4552
needs: build
@@ -58,6 +65,9 @@ jobs:
5865
needs: [license-check, build]
5966
runs-on: ubuntu-latest
6067
timeout-minutes: 5
68+
strategy:
69+
matrix:
70+
java: [8, 11, 17]
6171
steps:
6272
- uses: actions/checkout@v4
6373
- uses: actions/cache@v3
@@ -73,18 +83,21 @@ jobs:
7383
id: maven-cache
7484
with:
7585
path: ~/.m2/repository
76-
key: maven-cache-v1-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
86+
key: maven-cache-v1-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}-${{ matrix.java }}
7787
restore-keys: |
78-
maven-cache-v1-${{ runner.os }}-
88+
maven-cache-v1-${{ runner.os }}-${{ matrix.java }}
7989
- name: Start fixture server
8090
run: npm --prefix=playwright start &
8191
- name: Run Playwright tests
8292
run: mvn test -q -pl playwright
8393

8494
selenium-tests:
8595
needs: [license-check, build]
86-
timeout-minutes: 5
8796
runs-on: ubuntu-latest
97+
timeout-minutes: 5
98+
strategy:
99+
matrix:
100+
java: [8, 11, 17]
88101
steps:
89102
- uses: actions/checkout@v4
90103
- uses: actions/setup-python@v4
@@ -101,9 +114,9 @@ jobs:
101114
id: maven-cache
102115
with:
103116
path: ~/.m2/repository
104-
key: maven-cache-v1-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
117+
key: maven-cache-v1-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}-${{ matrix.java }}
105118
restore-keys: |
106-
maven-cache-v1-${{ runner.os }}-
119+
maven-cache-v1-${{ runner.os }}-${{ matrix.java }}
107120
- name: Start fixture server
108121
run: python -m http.server 8001 &
109122
working-directory: selenium/node_modules/axe-test-fixtures/fixtures

0 commit comments

Comments
 (0)