-
Notifications
You must be signed in to change notification settings - Fork 193
90 lines (77 loc) · 2.44 KB
/
ant-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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Java CI Test
env:
junit_platform_version: '1.9.3'
on:
- push
- pull_request
defaults:
run:
shell: bash
jobs:
test:
runs-on: ${{ matrix.os }}
env:
LANG: en_US.UTF-8
strategy:
fail-fast: false
matrix:
# test against latest update of each major Java version, as well as specific updates of LTS versions:
java: [11, 17, 21, 22]
os: [ubuntu-latest, macos-latest, windows-latest]
name: Java ${{ matrix.java }} on ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 256
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache/
~/work/josm/josm/tools/
key: ${{ runner.os }}-ivy2-${{ hashFiles('build.xml', 'ivy.xml', 'tools/ivy.xml') }}
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Install Ant
uses: JOSM/JOSMPluginAction/actions/setup-ant@v2
- name: Test with Ant
run: |
ANT="ant -DnoJavaFX=true test-unit-hardfail"
$ANT -Dtest.headless=true
- name: Dump errors if failed
if: ${{ failure() }}
run: "grep -L ', Failures: 0, Skipped: ' test/report/*.txt | xargs cat"
- name: Upload Ant reports
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Ant reports for JOSM ${{ needs.createrelease.outputs.josm_revision }} on java ${{ matrix.java }} on ${{ matrix.os }}
path: |
test/report/*.txt
test/report/TEST*.xml
hs_err*
publish-test-results:
name: "Publish Unit Tests Results"
needs: test
runs-on: ubuntu-latest
# the test job might be skipped, we don't need to run this job then
if: success() || failure()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish Test Report with action-junit-report
if: ${{ always() }}
uses: mikepenz/action-junit-report@v4
with:
report_paths: 'artifacts/**/*.xml'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Test Report with publish-unit-test-result-action
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: 'artifacts/**/*.xml'