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

Last change on this file since 17155 was 17155, checked in by simon04, 7 months ago

see #19888, see #19370 - GitHub Actions: specify LANG=en_US.UTF-8

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