-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 2.02 KB
/
build-and-test.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
on:
workflow_call:
env:
MAVEN_VERSION: 3.8.6
defaults:
run:
shell: bash
jobs:
build-and-test:
strategy:
# Don't fail other run's if one fails. Let them all finish.
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
java: [11, 17]
name: Build and test
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
# Checkout the code
- name: checkout
uses: actions/checkout@v4
# Setup Java
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '${{ matrix.java }}'
distribution: 'temurin'
architecture: x64
cache: 'maven'
# Build with Maven
- name: Build
run: mvn --batch-mode install assembly:single -DskipTests
working-directory: ./PowerDeComposer
# Test with Maven
- name: Run Unit Tests
run: mvn --batch-mode test -Dtest="RunPDCUnitTest"
working-directory: ./PowerDeComposer
- name: Test Report
uses: phoenix-actions/test-reporting@v12
id: test-report # Set ID reference for step
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-${{ matrix.os }}-java-${{ matrix.java }}
path: PowerDeComposer/target/surefire-reports/TEST-*.xml
reporter: java-junit
# Publish jars.
- uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
name: jar-without-dependencies-java-${{ matrix.java }}
path: PowerDeComposer/target/PowerDeComposer-*[0-9].jar
compression-level: 0 # no compression, since jar is already compressed
- uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
name: jar-with-dependencies-java-${{ matrix.java }}
path: PowerDeComposer/target/PowerDeComposer-*[0-9]-jar-with-dependencies.jar
compression-level: 0 # no compression, since jar is already compressed