source: josm/trunk/.github/workflows/ant.yml @ 17156

Last change on this file since 17156 was 17156, checked in by simon04, 6 weeks ago

see #19370 - GitHub Actions: we do not use junit-platform-console-standalone

File size: 3.2 KB
Line 
1name: Java CI
2env:
3  # ANT_HOME is also our ant version
4  ANT_HOME: "apache-ant-1.10.8"
5on:
6  push:
7    branches: [master]
8  pull_request:
9    branches: [master]
10
11defaults:
12  run:
13    shell: bash
14
15jobs:
16  build:
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, 14]
25        os: [ubuntu-latest, macos-latest, windows-latest]
26        headless: ["true", "false"]
27        exclude:
28          - java: 8
29            os: macos-latest
30          - java: 11
31            os: macos-latest
32          - headless: "false"
33            os: macos-latest
34          - headless: "false"
35            os: windows-latest
36    name: Java ${{ matrix.java }} on ${{ matrix.os }} with headless=${{ matrix.headless }}
37    steps:
38      - name: Checkout
39        uses: actions/checkout@v2
40        with:
41          fetch-depth: 64
42      - name: Cache
43        uses: actions/cache@v2.0.0
44        with:
45          path: |
46            ~/.ivy2/cache/
47            ~/work/josm/josm/tools/
48          key: ${{ runner.os }}-ivy2-${{ hashFiles('ivy.xml') }}
49      - name: Setup java
50        uses: actions/setup-java@v1.3.0
51        with:
52          java-version: ${{ matrix.java }}
53      - name: Install ant ${{ env.ANT_HOME }}
54        run: |
55          curl -s https://archive.apache.org/dist/ant/binaries/${{ env.ANT_HOME }}-bin.tar.gz | tar -xz
56      - name: Print ant version, expecting ${{ env.ANT_HOME }}
57        run: ${{ env.ANT_HOME }}/bin/ant -diagnostics
58      - name: Build with Ant, headless ${{ matrix.headless }}
59        run: |
60          ANT="${{ env.ANT_HOME }}/bin/ant -DnoJavaFX=true test-unit-hardfail"
61          if [ "${{ matrix.headless }}" == "true" ]; then
62            $ANT -Dtest.headless=true
63          else
64            xvfb-run $ANT -Dtest.headless=false
65          fi
66      - name: Dump errors if failed
67        if: ${{ failure() }}
68        run: "grep -L ', Failures: 0, Skipped: ' test/report/*.txt | xargs cat"
69      - name: Set revision env variable
70        if: ${{ always() }}
71        # Careful, you will only have a resources/REVISION if you've already built
72        run: echo "::set-env name=josm_revision::`awk '/Revision/{print $2}' resources/REVISION`"
73      - name: Upload Ant reports
74        if: ${{ always() }}
75        uses: actions/upload-artifact@v2
76        with:
77          name: Ant reports for JOSM ${{ env.josm_revision }} on java ${{ matrix.java }} on ${{ matrix.os }} with headless=${{ matrix.headless }}
78          path: test/report/*.txt
79      - name: Build and package for macOS
80        if: ${{ runner.os == 'macos' && always() }}
81        env:
82          CERT_MACOS_P12: ${{ secrets.CERT_MACOS_P12 }}
83          CERT_MACOS_PW: ${{ secrets.CERT_MACOS_PW }}
84          APPLE_ID_PW: ${{ secrets.APPLE_ID_PW }}
85        run: |
86          $ANT_HOME/bin/ant dist
87          ./native/macosx/macos-jpackage.sh ${{ env.josm_revision }}
88      - name: Upload JOSM.app for macOS
89        if: ${{ runner.os == 'macos' && always() }}
90        uses: actions/upload-artifact@v2
91        with:
92          name: JOSM.app revision ${{ env.josm_revision }}
93          path: dist/JOSM.zip
Note: See TracBrowser for help on using the repository browser.