source: josm/trunk/.github/workflows/ant-test.yml

Last change on this file was 19485, checked in by stoecker, 7 weeks ago

drop java 17

File size: 2.4 KB
RevLine 
[17694]1name: Java CI Test
2env:
[18725]3 junit_platform_version: '1.9.3'
[17694]4on:
5 - push
6 - pull_request
7
8defaults:
9 run:
10 shell: bash
11
12jobs:
13
14 test:
15 runs-on: ${{ matrix.os }}
16 env:
17 LANG: en_US.UTF-8
18 strategy:
19 fail-fast: false
20 matrix:
21 # test against latest update of each major Java version, as well as specific updates of LTS versions:
[19485]22 java: [11, 21, 25]
[17694]23 os: [ubuntu-latest, macos-latest, windows-latest]
24 name: Java ${{ matrix.java }} on ${{ matrix.os }}
25 steps:
26 - name: Checkout
[18993]27 uses: actions/checkout@v4
[17694]28 with:
29 fetch-depth: 256
30
31 - name: Cache
[18993]32 uses: actions/cache@v4
[17694]33 with:
34 path: |
35 ~/.ivy2/cache/
36 ~/work/josm/josm/tools/
[17918]37 key: ${{ runner.os }}-ivy2-${{ hashFiles('build.xml', 'ivy.xml', 'tools/ivy.xml') }}
[17694]38
39 - name: Setup Java ${{ matrix.java }}
[18993]40 uses: actions/setup-java@v4
[17694]41 with:
[17970]42 distribution: 'zulu'
[17694]43 java-version: ${{ matrix.java }}
44
[18670]45 - name: Install Ant
[19030]46 uses: JOSM/JOSMPluginAction/actions/setup-ant@v2
[17694]47
48 - name: Test with Ant
49 run: |
[18670]50 ANT="ant -DnoJavaFX=true test-unit-hardfail"
[17694]51 $ANT -Dtest.headless=true
52
53 - name: Dump errors if failed
54 if: ${{ failure() }}
55 run: "grep -L ', Failures: 0, Skipped: ' test/report/*.txt | xargs cat"
56
57 - name: Upload Ant reports
58 if: ${{ always() }}
[18993]59 uses: actions/upload-artifact@v4
[17694]60 with:
61 name: Ant reports for JOSM ${{ needs.createrelease.outputs.josm_revision }} on java ${{ matrix.java }} on ${{ matrix.os }}
[18026]62 path: |
63 test/report/*.txt
64 test/report/TEST*.xml
[18936]65 hs_err*
[17694]66
[18026]67 publish-test-results:
68 name: "Publish Unit Tests Results"
69 needs: test
70 runs-on: ubuntu-latest
71 # the test job might be skipped, we don't need to run this job then
72 if: success() || failure()
73
74 steps:
75 - name: Download Artifacts
[18993]76 uses: actions/download-artifact@v4
[18026]77 with:
78 path: artifacts
79
[17694]80 - name: Publish Test Report with action-junit-report
81 if: ${{ always() }}
[18993]82 uses: mikepenz/action-junit-report@v4
[17694]83 with:
[18026]84 report_paths: 'artifacts/**/*.xml'
[17970]85 token: ${{ secrets.GITHUB_TOKEN }}
[18026]86
87 - name: Publish Test Report with publish-unit-test-result-action
[18670]88 uses: EnricoMi/publish-unit-test-result-action@v2
[18026]89 with:
90 files: 'artifacts/**/*.xml'
Note: See TracBrowser for help on using the repository browser.