From 837f2058f3a3949aacf9b9e42db3ddf234aac2ca Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 13 May 2026 08:39:17 +0000 Subject: [PATCH 1/3] feat(gradle-build-pr): add run-tests flag for BOM and test-less projects Add a `run-tests` boolean input (default `true`) so the same workflow can be reused for projects with tests, projects without tests, and BOM-only publications. When `run-tests` is false the JUnit upload step and the aggregation job are skipped, and the resolved gradle task falls back from `build test` to `build`. Existing consumers keep their current behavior. --- .github/workflows/gradle-build-pr.yml | 29 +++++++++++++++++++-------- README.md | 13 +++++++++++- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.github/workflows/gradle-build-pr.yml b/.github/workflows/gradle-build-pr.yml index abbc557..e91a1fb 100644 --- a/.github/workflows/gradle-build-pr.yml +++ b/.github/workflows/gradle-build-pr.yml @@ -14,10 +14,21 @@ on: type: string default: "temurin" gradle-task: - description: "Gradle task(s) to run" + description: | + Gradle task(s) to run. Leave empty to use a default that depends on + `run-tests`: `build test` when tests exist, `build` otherwise. required: false type: string - default: "build test" + default: "" + run-tests: + description: | + Whether the project has a JVM test suite. When `false` the workflow + skips the JUnit upload and aggregation steps, and the default + `gradle-task` falls back to `build` (suitable for BOM-only or + test-less projects). + required: false + type: boolean + default: true runs-on: description: "JSON array of runners to use as a matrix" required: false @@ -103,6 +114,7 @@ jobs: ONELITEFEATHER_MAVEN_USERNAME: ${{ secrets.ONELITEFEATHER_MAVEN_USERNAME }} ONELITEFEATHER_MAVEN_PASSWORD: ${{ secrets.ONELITEFEATHER_MAVEN_PASSWORD }} GRADLE_OPTS: "-Dorg.gradle.parallel=true -Dorg.gradle.caching=true -Dorg.gradle.welcome=never" + RESOLVED_GRADLE_TASK: ${{ inputs.gradle-task != '' && inputs.gradle-task || (inputs.run-tests && 'build test' || 'build') }} steps: - name: Checkout uses: actions/checkout@v6 @@ -112,7 +124,8 @@ jobs: run: | echo "Runner : ${{ runner.os }} ${{ runner.arch }}" echo "JDK target : ${{ inputs.java-version }} (${{ inputs.java-distribution }})" - echo "Gradle task : ${{ inputs.gradle-task }}" + echo "Gradle task : ${RESOLVED_GRADLE_TASK}" + echo "Run tests : ${{ inputs.run-tests }}" echo "Debug logging: ${{ runner.debug }}" - name: Validate Gradle wrapper @@ -132,17 +145,17 @@ jobs: add-job-summary: 'on-failure' add-job-summary-as-pr-comment: 'on-failure' - - name: Run ${{ inputs.gradle-task }} + - name: Run Gradle (${{ env.RESOLVED_GRADLE_TASK }}) shell: bash run: | if [ "${RUNNER_DEBUG:-0}" = "1" ]; then - ./gradlew ${{ inputs.gradle-task }} --info --stacktrace + ./gradlew ${RESOLVED_GRADLE_TASK} --info --stacktrace else - ./gradlew ${{ inputs.gradle-task }} + ./gradlew ${RESOLVED_GRADLE_TASK} fi - name: Upload test reports - if: always() + if: ${{ always() && inputs.run-tests }} uses: actions/upload-artifact@v4 with: name: test-reports-${{ matrix.os }}-jdk${{ inputs.java-version }} @@ -155,7 +168,7 @@ jobs: test-report: name: Aggregate test results needs: build - if: ${{ always() && needs.build.result != 'skipped' }} + if: ${{ always() && needs.build.result != 'skipped' && inputs.run-tests }} runs-on: ubuntu-latest permissions: checks: write diff --git a/README.md b/README.md index 6a70259..47bb278 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ repositories by referencing a tagged release of this repo. - Java **25** on Temurin. - Three-OS matrix on PRs: `ubuntu-latest`, `windows-latest`, `macos-latest`. -- `gradle-build-pr` runs `build test` (no `clean`, to keep incremental caches). +- `gradle-build-pr` runs `build test` by default (no `clean`, to keep incremental caches). Set `run-tests: false` for BOM-only / test-less projects: the default task drops to `build` and the JUnit aggregation step is skipped. - Path filter: build only runs when files under `src/`, `*.gradle*`, `buildSrc/`, JVM sources, or `.github/workflows/**` changed. - Debug re-runs (`Re-run with debug logging`) automatically activate `--info --stacktrace`. - Test reports are uploaded as artifacts on every run and aggregated into a unified check + PR comment. @@ -66,6 +66,17 @@ jobs: secrets: inherit ``` +BOM-only or test-less project: + +```yaml +jobs: + build: + uses: OneLiteFeatherNET/workflows/.github/workflows/gradle-build-pr.yml@v2 + with: + run-tests: false + secrets: inherit +``` + Custom path filter (must define a `code:` key): ```yaml From 0d8ae52b357b9cdc6b1413c6c7b918ab2c13844f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 13 May 2026 08:47:40 +0000 Subject: [PATCH 2/3] chore(lint): exclude release-please CHANGELOG and renovate docs from lint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit markdownlint flags MD012 (multiple consecutive blank lines) on every release-please-generated CHANGELOG.md entry. Add a markdownlint-cli2 config that ignores the file — release-please owns the formatting. lychee gets a 403 from Cloudflare on docs.renovatebot.com even though the page resolves fine in browsers. Add the host to .lycheeignore so the link check stops failing on a healthy URL. --- .lycheeignore | 3 +++ .markdownlint-cli2.jsonc | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 .markdownlint-cli2.jsonc diff --git a/.lycheeignore b/.lycheeignore index 7d4a35b..d5c24ab 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -1,2 +1,5 @@ # Internal/private hosts that lychee cannot reach from GitHub-hosted runners. ^https://outline\.onelitefeather\.dev/.* + +# Cloudflare/bot-protection returns 403 to lychee but the page is healthy in browsers. +^https://docs\.renovatebot\.com/.* diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc new file mode 100644 index 0000000..5698d17 --- /dev/null +++ b/.markdownlint-cli2.jsonc @@ -0,0 +1,3 @@ +{ + "ignores": ["CHANGELOG.md"] +} From 363466f1e702076eb8ebe11d8c23af6b2e039d8a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 13 May 2026 08:50:02 +0000 Subject: [PATCH 3/3] fix(markdown-lint): drop --exclude-mail from lychee defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lychee 0.23 removed --exclude-mail (mail isn't checked unless --include-mail is passed). The lychee-action v2 ships lychee 0.23.0 since the last bump, so the default lychee-args were rejected as "unexpected argument". Drop the flag — behavior is unchanged. --- .github/workflows/markdown-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 2e8cb50..0707ecf 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -22,7 +22,7 @@ on: description: "Extra CLI args for lychee" required: false type: string - default: "--exclude-mail --max-redirects 5 --accept 200..=204,429 --no-progress" + default: "--max-redirects 5 --accept 200..=204,429 --no-progress" runs-on: description: "Runner image" required: false