|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + # Linux and Windows both, because path handling differs and most |
| 16 | + # consumers build on one or the other. |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + os: [ ubuntu-latest, windows-latest ] |
| 21 | + |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v7 |
| 26 | + |
| 27 | + - uses: actions/setup-java@v5 |
| 28 | + with: |
| 29 | + distribution: temurin |
| 30 | + java-version: '25' |
| 31 | + |
| 32 | + - uses: gradle/actions/setup-gradle@v6 |
| 33 | + |
| 34 | + - uses: actions/setup-python@v6 |
| 35 | + with: |
| 36 | + python-version: '3.x' |
| 37 | + |
| 38 | + - run: ./gradlew build jacocoTestReport |
| 39 | + |
| 40 | + # Confirms that something other than JMPQ3 can read what JMPQ3 wrote. |
| 41 | + # The Gradle run exported the rebuilt archives and their expected content |
| 42 | + # digests; tools/mpqref.py is an independent implementation. |
| 43 | + - name: Verify rebuilt archives with the reference implementation |
| 44 | + run: | |
| 45 | + python tools/mpqref.py selftest |
| 46 | + python tools/mpqref.py verify build/roundtrip/archives --manifest build/roundtrip/expected.tsv |
| 47 | +
|
| 48 | + # Catches drift between the committed golden manifest and the fixtures. |
| 49 | + - name: Check the golden manifest is up to date |
| 50 | + if: matrix.os == 'ubuntu-latest' |
| 51 | + run: | |
| 52 | + python tools/mpqref.py manifest src/test/resources/mpqs \ |
| 53 | + --names src/main/resources/DefaultListfile.txt \ |
| 54 | + -o /tmp/fixtures.tsv |
| 55 | + diff -u src/test/resources/golden/fixtures.tsv /tmp/fixtures.tsv |
| 56 | +
|
| 57 | + - name: Upload test report |
| 58 | + if: failure() |
| 59 | + uses: actions/upload-artifact@v7 |
| 60 | + with: |
| 61 | + name: test-report-${{ matrix.os }} |
| 62 | + path: build/reports/tests/test |
| 63 | + retention-days: 7 |
| 64 | + |
| 65 | + - name: Report coverage |
| 66 | + if: matrix.os == 'ubuntu-latest' |
| 67 | + uses: coverallsapp/github-action@v2 |
| 68 | + with: |
| 69 | + file: build/reports/jacoco/test/jacocoTestReport.xml |
| 70 | + format: jacoco |
| 71 | + fail-on-error: false |
0 commit comments