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
29 changes: 21 additions & 8 deletions .github/workflows/gradle-build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -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/.*
3 changes: 3 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignores": ["CHANGELOG.md"]
}
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
Loading