Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/actions/install-reqstool/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
python-version:
description: "Python version to use."
required: false
default: "3.13"
default: "3.15"

runs:
using: "composite"
Expand Down
10 changes: 7 additions & 3 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,18 @@
// Version constraints
// =====================================================

// Tool-version policy (reqstool/.github#385): Python follows the latest
// release (no cap); Java and Node follow the latest LTS only.
{
matchDepNames: ["python"],
allowedVersions: "<=3.13",
// Odd Node majors are never LTS.
matchDepNames: ["node"],
allowedVersions: "/^\\d*[02468]([.]|$)/",
},

{
// Java LTS releases. Add the next LTS here when it ships (every 2 years).
matchDepNames: ["java", "openjdk", "temurin"],
allowedVersions: "<=21",
allowedVersions: "/^(21|25|29)([.+]|$)/",
},

{
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/common-reqstool-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Verify (reqstool)

# The reqstool gate shared by every repo: install reqstool from PyPI and from
# reqstool-client@main, then run `reqstool status` over the caller's checkout
# plus the build/ output (junit, coverage, annotations) produced by the build
# workflow. Replaces the identical tail of each repo's inline build job.

on:
workflow_call:
inputs:
build-artifact:
description: "Name of the artifact holding the build/ output (see the build workflows' build-artifact-name)."
required: false
type: string
default: "dist-build"
build-directory:
description: "Directory the build artifact is extracted to, relative to repo root (build for Python/Gradle, target for Maven)."
required: false
type: string
default: "build"
reqstool-path:
description: "Path to the reqstool data directory, relative to repo root."
required: false
type: string
default: "docs/reqstool"
fail-if-incomplete:
description: "Fail unless every requirement is complete."
required: false
type: boolean
default: true

permissions:
contents: read

jobs:
verify:
name: verify
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
reqstool-source: [pypi, main]
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false

- uses: actions/download-artifact@v8.0.2
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
name: ${{ inputs.build-artifact }}
path: ${{ inputs.build-directory }}

# Composite actions of this repo are addressed by full path and pinned to a
# released SHA like any other caller (`./` would resolve against the caller's
# workspace); Renovate bumps them with every other reqstool/.github pin.
- uses: reqstool/.github/.github/actions/install-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
with:
reqstool-source: ${{ matrix.reqstool-source }}

# Not yet in the latest PyPI release; supplementary to the status gate.
- if: matrix.reqstool-source == 'main'
uses: reqstool/.github/.github/actions/validate-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
with:
reqstool-path: ${{ inputs.reqstool-path }}

- uses: reqstool/.github/.github/actions/reqstool-status@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
with:
reqstool-path: ${{ inputs.reqstool-path }}
fail-if-incomplete: ${{ inputs.fail-if-incomplete }}
71 changes: 63 additions & 8 deletions .github/workflows/java-build-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ on:
type: string
default: "."
java-version:
description: "JDK version to use."
description: "JDK used for the build and the artifacts (the latest LTS)."
required: false
type: string
default: "21"
# renovate: datasource=java-version depName=java
default: "25"
java-versions:
description: >
JSON array of JDKs the test suite runs on, on Linux. One entry by policy
(latest LTS); adding a leg is a one-line change.
required: false
type: string
default: '["25"]'
ref:
description: "Branch, tag or SHA to build. Empty = the caller's ref."
required: false
Expand All @@ -26,20 +34,53 @@ on:
required: false
type: string
default: "dist"
post-test-command:
description: >
Optional repo-specific bash command run after tests, before upload --
e.g. self-applying the project's own annotation processor into
build/reqstool/annotations.yml.
required: false
type: string
default: ""

permissions:
contents: read

jobs:
build:
test:
name: test (${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: ${{ fromJSON(inputs.java-versions) }}
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
# Full history and tags: the version is derived from git state by
# git-dyn-semver, so a shallow clone would build the wrong number rather
# than fail.
# git-dyn-semver, 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 }}

- uses: actions/setup-java@v6.3.0
with:
java-version: ${{ matrix.java }}
distribution: temurin

- run: ./gradlew --console=plain clean build

build:
needs: test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
Expand All @@ -52,13 +93,27 @@ jobs:
java-version: ${{ inputs.java-version }}
distribution: temurin

- run: ./gradlew clean build
- name: Build and run tests
run: ./gradlew --console=plain clean build

- name: Report the resolved version
run: ./gradlew printVersion -q
run: ./gradlew --console=plain printVersion -q

- name: Run post-test command
if: ${{ inputs.post-test-command != '' }}
env:
POST_TEST_COMMAND: ${{ inputs.post-test-command }}
run: eval "$POST_TEST_COMMAND"

- uses: actions/upload-artifact@v7.0.2
with:
name: ${{ inputs.artifact-name }}
path: ${{ inputs.working-directory }}/build/libs/*.jar
path: |
${{ inputs.working-directory }}/build/libs/*.jar
if-no-files-found: ignore

# build/ output (test reports, annotations, reqstool zip) for the reqstool verify job.
- uses: actions/upload-artifact@v7.0.2
with:
name: ${{ inputs.artifact-name }}-build
path: ${{ inputs.working-directory }}/build/
65 changes: 60 additions & 5 deletions .github/workflows/java-build-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ on:
type: string
default: "."
java-version:
description: "JDK version to use."
description: "JDK used for the build and the artifacts (the latest LTS)."
required: false
type: string
default: "21"
# renovate: datasource=java-version depName=java
default: "25"
java-versions:
description: >
JSON array of JDKs the test suite runs on, on Linux. One entry by policy
(latest LTS); adding a leg is a one-line change.
required: false
type: string
default: '["25"]'
ref:
description: "Branch, tag or SHA to build. Empty = the caller's ref."
required: false
Expand All @@ -26,19 +34,53 @@ on:
required: false
type: string
default: "dist"
post-test-command:
description: >
Optional repo-specific bash command run after tests, before upload --
e.g. self-applying the project's own annotation processor into
target/reqstool/annotations.yml.
required: false
type: string
default: ""

permissions:
contents: read

jobs:
test:
name: test (${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: ${{ fromJSON(inputs.java-versions) }}
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
# Full history and tags: the version is derived from git state by
# Nisse, 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 }}

- uses: actions/setup-java@v6.3.0
with:
java-version: ${{ matrix.java }}
distribution: temurin

- run: mvn --batch-mode clean verify

build:
needs: test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
# Full history and tags: the version is derived from git state by Nisse,
# so a shallow clone would build the wrong number rather than fail.
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
Expand All @@ -51,15 +93,28 @@ jobs:
java-version: ${{ inputs.java-version }}
distribution: temurin

- run: mvn --batch-mode clean verify
- name: Build and run tests
run: mvn --batch-mode clean verify

- name: Report the resolved version
run: mvn --batch-mode help:evaluate -Dexpression=project.version -q -DforceStdout

- name: Run post-test command
if: ${{ inputs.post-test-command != '' }}
env:
POST_TEST_COMMAND: ${{ inputs.post-test-command }}
run: eval "$POST_TEST_COMMAND"

- uses: actions/upload-artifact@v7.0.2
with:
name: ${{ inputs.artifact-name }}
path: |
${{ inputs.working-directory }}/target/*.jar
${{ inputs.working-directory }}/target/*.pom
if-no-files-found: ignore

# target/ output (test reports, annotations, reqstool zip) for the reqstool verify job.
- uses: actions/upload-artifact@v7.0.2
with:
name: ${{ inputs.artifact-name }}-build
path: ${{ inputs.working-directory }}/target/
21 changes: 18 additions & 3 deletions .github/workflows/java-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,37 @@ on:
description: "JDK version to use."
required: false
type: string
default: "21"
# renovate: datasource=java-version depName=java
default: "25"
build-tool:
description: "Build tool: maven or gradle."
required: false
type: string
default: "maven"

permissions:
contents: read

jobs:
lint:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
# Version derivation (Nisse / git-dyn-semver) reads git state.
fetch-depth: 0
fetch-tags: true

- uses: actions/setup-java@v6.3.0
with:
java-version: ${{ inputs.java-version }}
distribution: temurin

- run: mvn clean validate
- name: Check formatting (Maven)
if: ${{ inputs.build-tool == 'maven' }}
run: mvn --batch-mode clean validate

- name: Check formatting (Gradle)
if: ${{ inputs.build-tool == 'gradle' }}
run: ./gradlew --console=plain checkFormat
Loading
Loading