Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/test/resources/** text eol=lf
82 changes: 38 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,45 @@ permissions:
contents: read

jobs:
linting:
name: Check linting
uses: ./.github/workflows/lint.yml
lint:
uses: reqstool/.github/.github/workflows/java-lint.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2

build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
reqstool-source: [pypi, main]
steps:
# Full history and tags: Nisse derives the version from git state, so a
# shallow clone would build the wrong number rather than fail.
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
fetch-depth: 0
fetch-tags: true
ref: ${{ inputs.ref || github.ref }}
- name: Set up JDK
uses: actions/setup-java@v6.3.0
with:
java-version: "21.0.12+8.0.LTS"
distribution: "temurin"
- name: Build and run tests
run: mvn clean verify
- name: Install plugin into local repository
run: mvn -DskipTests install
- name: Self-apply plugin to assemble dataset zip
run: |
VERSION=$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)
mvn io.github.reqstool:reqstool-maven-plugin:${VERSION}:assemble-and-attach-zip-artifact \
-Dreqstool.datasetPath=docs/reqstool \
-Dreqstool.outputDirectory=target/reqstool
- name: Install reqstool
uses: reqstool/.github/.github/actions/install-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
with:
reqstool-source: ${{ matrix.reqstool-source }}
- name: Validate reqstool spec completeness
# not yet available in the latest PyPI release
if: matrix.reqstool-source == 'main'
uses: reqstool/.github/.github/actions/validate-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
- name: Run reqstool status
uses: reqstool/.github/.github/actions/reqstool-status@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
with:
fail-if-incomplete: "true"
needs: lint
uses: reqstool/.github/.github/workflows/java-build-maven.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
with:
ref: ${{ inputs.ref }}
artifact-name: ${{ inputs.artifact-name || 'dist' }}
post-test-command: |
mvn --batch-mode -DskipTests install
VERSION=$(mvn --batch-mode -q help:evaluate -Dexpression=project.version -DforceStdout)
mvn --batch-mode io.github.reqstool:reqstool-maven-plugin:${VERSION}:assemble-and-attach-zip-artifact \
-Dreqstool.datasetPath=docs/reqstool \
-Dreqstool.outputDirectory=target/reqstool

reqstool:
needs: build
uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
with:
build-artifact: ${{ inputs.artifact-name || 'dist' }}-build
build-directory: target

smoke:
needs: build
uses: reqstool/.github/.github/workflows/java-smoke.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2
with:
command: mvn --batch-mode verify

validate-openspec:
uses: reqstool/.github/.github/workflows/common-validate-openspec.yml@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1

ci:
if: ${{ always() }}
needs: [lint, build, reqstool, smoke, validate-openspec]
runs-on: ubuntu-latest
steps:
- name: Fail unless every needed job succeeded
env:
NEEDS: ${{ toJSON(needs) }}
run: |
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)'
21 changes: 0 additions & 21 deletions .github/workflows/lint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ For DCO sign-off, commit conventions, and code review process, see the organizat

## Prerequisites

- Java 21+
- Java 25+
- Maven 3.9+
- [reqstool](https://github.com/reqstool/reqstool-client) (`pipx install reqstool`)
- [OpenSpec](https://github.com/Fission-AI/OpenSpec) (`npm install -g @fission-ai/openspec`)
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Run `mvn verify` and the ZIP artifact will be created automatically.
== Prerequisites

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

== License
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- for Maven Compiler -->
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.release>21</maven.compiler.release>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<maven.compiler.release>25</maven.compiler.release>

</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private void writeCombinedOutputToFile(File outputFile, JsonNode combinedOutputN

try (Writer writer = new PrintWriter(
new OutputStreamWriter(new FileOutputStream(outputFile), StandardCharsets.UTF_8))) {
writer.write(YAML_LANG_SERVER_SCHEMA_ANNOTATIONS + System.lineSeparator());
writer.write(YAML_LANG_SERVER_SCHEMA_ANNOTATIONS + "\n");
yamlMapper.writeValue(writer, combinedOutputNode);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void testCombine() throws IOException {
void testAssembleZipArtifact() throws Exception {
ClassLoader classLoader = getClass().getClassLoader();
URL resourcePath = classLoader.getResource("zip");
Path zipResourcePath = Paths.get(resourcePath.getFile());
Path zipResourcePath = Paths.get(resourcePath.toURI());

RequirementsToolMojo mojo = new RequirementsToolMojo();

Expand Down
Loading