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

Last change on this file since 17086 was 17086, checked in by simon04, 12 months ago

fix #19249 - CI: download Ant from a stable URL

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