Skip to content

Commit 4fe003a

Browse files
authored
Phase 0: correctness and safety fixes, Java 25 baseline (#51)
1 parent e28f699 commit 4fe003a

37 files changed

Lines changed: 6531 additions & 1999 deletions

.circleci/config.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Normalise line endings so an editor or script on Windows cannot turn a
2+
# one-line change into a whole-file diff.
3+
* text=auto eol=lf
4+
5+
# Fixtures and build artefacts are binary.
6+
*.w3x binary
7+
*.w3m binary
8+
*.scx binary
9+
*.mpq binary
10+
*.blp binary
11+
*.jar binary

.github/workflows/build.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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
Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
2-
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
1+
# Publishes the library to GitHub Packages when a release is created.
32

43
name: Gradle Package
54

@@ -8,30 +7,25 @@ on:
87
types: [created]
98

109
jobs:
11-
build:
12-
10+
publish:
1311
runs-on: ubuntu-latest
1412
permissions:
1513
contents: read
1614
packages: write
1715

1816
steps:
19-
- uses: actions/checkout@v2
20-
- name: Set up JDK 11
21-
uses: actions/setup-java@v2
22-
with:
23-
java-version: '11'
24-
distribution: 'adopt'
25-
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
26-
settings-path: ${{ github.workspace }} # location for the settings.xml file
27-
28-
- name: Build with Gradle
29-
run: gradle build
30-
31-
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
32-
# the publishing section of your build.gradle
33-
- name: Publish to GitHub Packages
34-
run: gradle publish
35-
env:
36-
USERNAME: ${{ github.actor }}
37-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
- uses: actions/checkout@v7
18+
19+
- uses: actions/setup-java@v5
20+
with:
21+
distribution: temurin
22+
java-version: '25'
23+
24+
- uses: gradle/actions/setup-gradle@v6
25+
26+
- run: ./gradlew build
27+
28+
- run: ./gradlew publish
29+
env:
30+
USERNAME: ${{ github.actor }}
31+
TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@ out/
2121
src/test/resources/mpqs/War3x.w3x
2222
src/test/resources/War3x.w3x
2323

24-
.scannerwork
24+
.scannerwork
25+
# Python bytecode from tools/
26+
__pycache__/
27+
*.pyc

0 commit comments

Comments
 (0)