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

Last change on this file since 17918 was 17918, checked in by simon04, 3 years ago

see #20946 - GitHub Actions: hash also build.xml and tools/ivy.xml for cache key

File size: 2.6 KB
Line 
1name: Java CI Test
2env:
3 junit_platform_version: '1.7.0'
4 # ANT_HOME is also our ant version
5 ANT_HOME: 'apache-ant-1.10.9'
6on:
7 - push
8 - pull_request
9
10defaults:
11 run:
12 shell: bash
13
14jobs:
15
16 test:
17 runs-on: ${{ matrix.os }}
18 env:
19 LANG: en_US.UTF-8
20 strategy:
21 fail-fast: false
22 matrix:
23 # test against latest update of each major Java version, as well as specific updates of LTS versions:
24 java: [8, 11, 16, 17-ea]
25 os: [ubuntu-latest, macos-latest, windows-latest]
26 exclude:
27 - java: 8
28 os: macos-latest
29 - java: 11
30 os: macos-latest
31 name: Java ${{ matrix.java }} on ${{ matrix.os }}
32 steps:
33 - name: Checkout
34 uses: actions/checkout@v2
35 with:
36 fetch-depth: 256
37
38 - name: Cache
39 uses: actions/cache@v2.0.0
40 with:
41 path: |
42 ~/.ivy2/cache/
43 ~/work/josm/josm/tools/
44 key: ${{ runner.os }}-ivy2-${{ hashFiles('build.xml', 'ivy.xml', 'tools/ivy.xml') }}
45
46 - name: Setup Java ${{ matrix.java }}
47 uses: actions/setup-java@v1.4.3
48 with:
49 java-version: ${{ matrix.java }}
50
51 - name: Install Ant ${{ env.ANT_HOME }}
52 run: |
53 if [ ! -f tools/${{ env.ANT_HOME }}-bin.tar.gz ]; then
54 curl -o tools/${{ env.ANT_HOME }}-bin.tar.gz https://downloads.apache.org/ant/binaries/${{ env.ANT_HOME }}-bin.tar.gz
55 fi
56 tar zxf tools/${{ env.ANT_HOME }}-bin.tar.gz
57
58 - name: Ant diagnostics
59 run: ${{ env.ANT_HOME }}/bin/ant -diagnostics
60
61 - name: Test with Ant
62 run: |
63 ANT="${{ env.ANT_HOME }}/bin/ant -DnoJavaFX=true test-unit-hardfail"
64 $ANT -Dtest.headless=true
65
66 - name: Dump errors if failed
67 if: ${{ failure() }}
68 run: "grep -L ', Failures: 0, Skipped: ' test/report/*.txt | xargs cat"
69
70 - name: Upload Ant reports
71 if: ${{ always() }}
72 uses: actions/upload-artifact@v2
73 with:
74 name: Ant reports for JOSM ${{ needs.createrelease.outputs.josm_revision }} on java ${{ matrix.java }} on ${{ matrix.os }}
75 path: 'test/report/*.txt'
76
77 - name: Publish Test Report with junit-report-annotations-action
78 uses: ashley-taylor/junit-report-annotations-action@1.3
79 if: ${{ always() }}
80 with:
81 path: 'test/report/TEST*.xml'
82 access-token: ${{ secrets.GITHUB_TOKEN }}
83
84 - name: Publish Test Report with action-junit-report
85 if: ${{ always() }}
86 uses: mikepenz/action-junit-report@v1
87 with:
88 report_paths: 'test/report/TEST*.xml'
89 github_token: ${{ secrets.GITHUB_TOKEN }}
Note: See TracBrowser for help on using the repository browser.