-
Notifications
You must be signed in to change notification settings - Fork 238
79 lines (78 loc) · 2.24 KB
/
build.yaml
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
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build Maven 3
strategy:
fail-fast: false
max-parallel: 16
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
java:
- 11
- 17
- 21
maven:
- 3.9.6
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: s4u/[email protected]
with:
java-distribution: 'temurin'
java-version: ${{ matrix.java }}
maven-version: ${{ matrix.maven }}
- name: Cache dependencies
uses: actions/cache@v4
env:
java_version: ${{ matrix.java }}
with:
path: ~/.m2/repository
key: mvn-cache-${{ runner.os }}-${{ env.java_version }}
restore-keys: mvn-cache-${{ runner.os }}-${{ env.java_version }}
- name: Install Graphviz (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt install graphviz
- name: Install Graphviz (Win)
if: matrix.os == 'windows-latest'
run: choco install graphviz --no-progress
- name: Install Graphviz (macOS)
if: matrix.os == 'macos-latest'
run: brew install graphviz
- name: Environment
run: mvn -version
- name: Clean all modules
run: mvn -B clean
- name: Set MAVEN_HOME and Test (Windows)
if: matrix.os == 'windows-latest'
run: |
set MAVEN_HOME="$(which mvn)"
echo "MAVEN_HOME: $MAVEN_HOME"
mvn -B test -pl tests
- name: Set MAVEN_HOME and Test
if: matrix.os != 'windows-latest'
run: |
export MAVEN_HOME="$(which mvn)"
echo "MAVEN_HOME: $MAVEN_HOME"
mvn -B test -pl tests
- name: Upload test output
uses: actions/upload-artifact@v4
env:
os_name: ${{ matrix.os }}
java_version: ${{ matrix.java }}
maven_version: ${{ matrix.maven }}
if: always()
with:
name: tests-output-${{ env.os_name }}-${{ env.java_version }}-${{ env.maven_version }}
path: tests/target/*