Skip to content

Commit 2b19f60

Browse files
jimisolaclaude
andauthored
ci: use shared build and lint workflows (#227)
* ci: use shared build and lint workflows Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola <jimisola@jimisola.com> * fix: make output and tests line-ending and path safe on Windows Write the annotations header with LF like the YAML body, pin test fixtures to LF, and resolve the zip resource through its URI instead of a URL path (invalid on Windows). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola <jimisola@jimisola.com> * build: compile for Java 25, the latest LTS Compile target now equals the CI JDK. Consumers need Java 25 or newer to run the plugin or processor. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola <jimisola@jimisola.com> * ci: pin shared workflows to the .github 1.3.0 SHA Pin to 193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 (# 1.3.0). The 1.3.0 tag is pending; Renovate resolves it once it exists. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola <jimisola@jimisola.com> * chore: drop explanatory comments The PR description and commits carry the rationale. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola <jimisola@jimisola.com> * ci: pin shared workflows to .github 1.2.2 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola <jimisola@jimisola.com> --------- Signed-off-by: Jimisola <jimisola@jimisola.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 0e54333 commit 2b19f60

8 files changed

Lines changed: 46 additions & 72 deletions

File tree

‎.gitattributes‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/test/resources/** text eol=lf

‎.github/workflows/build.yml‎

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -28,51 +28,45 @@ permissions:
2828
contents: read
2929

3030
jobs:
31-
linting:
32-
name: Check linting
33-
uses: ./.github/workflows/lint.yml
31+
lint:
32+
uses: reqstool/.github/.github/workflows/java-lint.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
33+
3434
build:
35-
runs-on: ubuntu-latest
36-
strategy:
37-
fail-fast: false
38-
matrix:
39-
reqstool-source: [pypi, main]
40-
steps:
41-
# Full history and tags: Nisse derives the version from git state, so a
42-
# shallow clone would build the wrong number rather than fail.
43-
- uses: actions/checkout@v7.0.1
44-
with:
45-
persist-credentials: false
46-
fetch-depth: 0
47-
fetch-tags: true
48-
ref: ${{ inputs.ref || github.ref }}
49-
- name: Set up JDK
50-
uses: actions/setup-java@v6.3.0
51-
with:
52-
java-version: "21.0.12+8.0.LTS"
53-
distribution: "temurin"
54-
- name: Build and run tests
55-
run: mvn clean verify
56-
- name: Install plugin into local repository
57-
run: mvn -DskipTests install
58-
- name: Self-apply plugin to assemble dataset zip
59-
run: |
60-
VERSION=$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)
61-
mvn io.github.reqstool:reqstool-maven-plugin:${VERSION}:assemble-and-attach-zip-artifact \
62-
-Dreqstool.datasetPath=docs/reqstool \
63-
-Dreqstool.outputDirectory=target/reqstool
64-
- name: Install reqstool
65-
uses: reqstool/.github/.github/actions/install-reqstool@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
66-
with:
67-
reqstool-source: ${{ matrix.reqstool-source }}
68-
- name: Validate reqstool spec completeness
69-
# not yet available in the latest PyPI release
70-
if: matrix.reqstool-source == 'main'
71-
uses: reqstool/.github/.github/actions/validate-reqstool@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
72-
- name: Run reqstool status
73-
uses: reqstool/.github/.github/actions/reqstool-status@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
74-
with:
75-
fail-if-incomplete: "true"
35+
needs: lint
36+
uses: reqstool/.github/.github/workflows/java-build-maven.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
37+
with:
38+
ref: ${{ inputs.ref }}
39+
artifact-name: ${{ inputs.artifact-name || 'dist' }}
40+
post-test-command: |
41+
mvn --batch-mode -DskipTests install
42+
VERSION=$(mvn --batch-mode -q help:evaluate -Dexpression=project.version -DforceStdout)
43+
mvn --batch-mode io.github.reqstool:reqstool-maven-plugin:${VERSION}:assemble-and-attach-zip-artifact \
44+
-Dreqstool.datasetPath=docs/reqstool \
45+
-Dreqstool.outputDirectory=target/reqstool
46+
47+
reqstool:
48+
needs: build
49+
uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
50+
with:
51+
build-artifact: ${{ inputs.artifact-name || 'dist' }}-build
52+
build-directory: target
53+
54+
smoke:
55+
needs: build
56+
uses: reqstool/.github/.github/workflows/java-smoke.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
57+
with:
58+
command: mvn --batch-mode verify
7659

7760
validate-openspec:
7861
uses: reqstool/.github/.github/workflows/common-validate-openspec.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
62+
63+
ci:
64+
if: ${{ always() }}
65+
needs: [lint, build, reqstool, smoke, validate-openspec]
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Fail unless every needed job succeeded
69+
env:
70+
NEEDS: ${{ toJSON(needs) }}
71+
run: |
72+
echo "$NEEDS" | python3 -c 'import json,sys; r={k:v["result"] for k,v in json.load(sys.stdin).items()}; print(r); sys.exit(0 if all(v=="success" for v in r.values()) else 1)'

‎.github/workflows/lint.yml‎

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

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ For DCO sign-off, commit conventions, and code review process, see the organizat
66

77
## Prerequisites
88

9-
- Java 21+
9+
- Java 25+
1010
- Maven 3.9+
1111
- [reqstool](https://github.com/reqstool/reqstool-client) (`pipx install reqstool`)
1212
- [OpenSpec](https://github.com/Fission-AI/OpenSpec) (`npm install -g @fission-ai/openspec`)

‎docs/modules/ROOT/pages/index.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Run `mvn verify` and the ZIP artifact will be created automatically.
7070
== Prerequisites
7171

7272
* Maven 3.9+
73-
* Java 21+
73+
* Java 25+
7474
* A `requirements.yml` file in the dataset directory (default: `reqstool/`)
7575

7676
== License

‎pom.xml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
4949

5050
<!-- for Maven Compiler -->
51-
<maven.compiler.source>21</maven.compiler.source>
52-
<maven.compiler.target>21</maven.compiler.target>
53-
<maven.compiler.release>21</maven.compiler.release>
51+
<maven.compiler.source>25</maven.compiler.source>
52+
<maven.compiler.target>25</maven.compiler.target>
53+
<maven.compiler.release>25</maven.compiler.release>
5454

5555
</properties>
5656

‎src/main/java/io/github/reqstool/plugins/maven/RequirementsToolMojo.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private void writeCombinedOutputToFile(File outputFile, JsonNode combinedOutputN
226226

227227
try (Writer writer = new PrintWriter(
228228
new OutputStreamWriter(new FileOutputStream(outputFile), StandardCharsets.UTF_8))) {
229-
writer.write(YAML_LANG_SERVER_SCHEMA_ANNOTATIONS + System.lineSeparator());
229+
writer.write(YAML_LANG_SERVER_SCHEMA_ANNOTATIONS + "\n");
230230
yamlMapper.writeValue(writer, combinedOutputNode);
231231
}
232232
}

‎src/test/java/io/github/reqstool/plugins/maven/RequirementsToolMojoTests.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void testCombine() throws IOException {
9191
void testAssembleZipArtifact() throws Exception {
9292
ClassLoader classLoader = getClass().getClassLoader();
9393
URL resourcePath = classLoader.getResource("zip");
94-
Path zipResourcePath = Paths.get(resourcePath.getFile());
94+
Path zipResourcePath = Paths.get(resourcePath.toURI());
9595

9696
RequirementsToolMojo mojo = new RequirementsToolMojo();
9797

0 commit comments

Comments
 (0)