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
2 changes: 2 additions & 0 deletions .clineignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ build/
*/build/
!build/docs/
!build/docs/**
!build/generated/
!build/generated/**

# === Dependency/Cache directories ===
.gradle/
Expand Down
2 changes: 1 addition & 1 deletion .clinerules/coding.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The root project MUST NOT contain any code: it is a parent project which coordin

You SHOULD prefer modern Java idioms: records, pattern matching, sealed interfaces/classes, `var` for local variables.
You MUST NOT use fully qualified class names unless there is a conflict between 2 class names in different packages.
You MUST annotate the code with nullability annotations (`io.micronaut.core.annotation.Nullable`, `io.micronaut.core.annotation.NonNull`).
You MUST annotate the code with nullability annotations (`org.jspecify.annotations.Nullable`, `org.jspecify.annotations.NonNull`).
You MUST NOT use reflection: Micronaut is a reflection-free framework tailored for integration with GraalVM.
You MUST use `jakarta.inject` for dependency injection, NOT `javax.inject`.

Expand Down
2 changes: 1 addition & 1 deletion .github/instructions/coding.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The root project MUST NOT contain any code: it is a parent project which coordin

You SHOULD prefer modern Java idioms: records, pattern matching, sealed interfaces/classes, `var` for local variables.
You MUST NOT use fully qualified class names unless there is a conflict between 2 class names in different packages.
You MUST annotate the code with nullability annotations (`io.micronaut.core.annotation.Nullable`, `io.micronaut.core.annotation.NonNull`).
You MUST annotate the code with nullability annotations (`org.jspecify.annotations.Nullable`, `org.jspecify.annotations.NonNull`).
You MUST NOT use reflection: Micronaut is a reflection-free framework tailored for integration with GraalVM.
You MUST use `jakarta.inject` for dependency injection, NOT `javax.inject`.

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/central-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ jobs:
central-sync:
runs-on: ubuntu-latest
steps:
- name: Remove system JDKs
run: |
sudo rm -rf /usr/lib/jvm/*
unset JAVA_HOME
export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v '/usr/lib/jvm' | paste -sd:)
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
ref: v${{ github.event.inputs.release_version }}
- uses: gradle/actions/wrapper-validation@v4
- uses: gradle/actions/wrapper-validation@v5
- name: Set up JDK
uses: actions/setup-java@v5
with:
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/graalvm-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ jobs:
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Build Matrix
uses: micronaut-projects/github-actions/graalvm/build-matrix@master
id: build-matrix
with:
java-version: '21'
build:
needs: build_matrix
if: github.repository != 'micronaut-projects/micronaut-project-template'
Expand All @@ -44,14 +42,19 @@ jobs:
DEVELOCITY_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
DEVELOCITY_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
steps:
- uses: actions/checkout@v5
- name: Remove system JDKs
run: |
sudo rm -rf /usr/lib/jvm/*
unset JAVA_HOME
export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v '/usr/lib/jvm' | paste -sd:)
- uses: actions/checkout@v6
- name: Pre-Build Steps
uses: micronaut-projects/github-actions/graalvm/pre-build@master
id: pre-build
with:
java: ${{ matrix.java }}
gradle-java: '21'
distribution: ${{ matrix.distribution }}
nativeTestTask: ${{ matrix.native_test_task }}
- name: Build Steps
uses: micronaut-projects/github-actions/graalvm/build@master
id: build
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/graalvm-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
push:
branches:
- master
- '[1-9]+.[0-9]+.x'
- '[0-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[1-9]+.[0-9]+.x'
- '[0-9]+.[0-9]+.x'
jobs:
build_matrix:
if: github.repository != 'micronaut-projects/micronaut-project-template'
Expand All @@ -24,7 +24,7 @@ jobs:
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Build Matrix
uses: micronaut-projects/github-actions/graalvm/build-matrix@master
id: build-matrix
Expand All @@ -37,21 +37,27 @@ jobs:
strategy:
max-parallel: 6
matrix:
java: [ '21' ]
java: ['21']
native_test_task: ${{ fromJson(needs.build_matrix.outputs.matrix).native_test_task }}
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
DEVELOCITY_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
DEVELOCITY_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
steps:
- uses: actions/checkout@v5
- name: Remove system JDKs
run: |
sudo rm -rf /usr/lib/jvm/*
unset JAVA_HOME
export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v '/usr/lib/jvm' | paste -sd:)
- uses: actions/checkout@v6
- name: Pre-Build Steps
uses: micronaut-projects/github-actions/graalvm/pre-build@master
id: pre-build
with:
distribution: 'graalvm'
gradle-java: '21'
java: ${{ matrix.java }}
nativeTestTask: ${{ matrix.native_test_task }}
- name: Build Steps
uses: micronaut-projects/github-actions/graalvm/build@master
id: build
Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ on:
push:
branches:
- master
- '[1-9]+.[0-9]+.x'
- '[0-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[1-9]+.[0-9]+.x'
- '[0-9]+.[0-9]+.x'
jobs:
build:
if: github.repository != 'micronaut-projects/micronaut-project-template'
runs-on: ubuntu-latest
strategy:
matrix:
java: ['21']
java: ['21', '25']
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
DEVELOCITY_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
Expand All @@ -34,6 +34,11 @@ jobs:
OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }}
steps:
# https://github.com/actions/virtual-environments/issues/709
- name: Remove system JDKs
run: |
sudo rm -rf /usr/lib/jvm/*
unset JAVA_HOME
export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v '/usr/lib/jvm' | paste -sd:)
- name: "🗑 Free disk space"
run: |
sudo rm -rf "/usr/local/share/boost"
Expand All @@ -42,33 +47,34 @@ jobs:
df -h

- name: "📥 Checkout repository"
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: "🔧 Setup GraalVM CE"
uses: graalvm/setup-graalvm@v1.3.6
uses: graalvm/setup-graalvm@v1.4.4
with:
distribution: 'graalvm'
java-version: ${{ matrix.java }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: "🔧 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5

- name: "❓ Optional setup step"
run: |
[ -f ./setup.sh ] && ./setup.sh || [ ! -f ./setup.sh ]

- name: "🚔 Sonatype Scan"
if: env.OSS_INDEX_PASSWORD != '' && matrix.java == '21'
id: sonatypescan
run: |
./gradlew ossIndexAudit --no-parallel --info

- name: "🛠 Build with Gradle"
id: gradle
run: |
./gradlew check --no-daemon --continue
./gradlew check jacocoReport --no-daemon --continue

- name: "🔎 Run static analysis"
if: env.SONAR_TOKEN != '' && matrix.java == '21'
Expand All @@ -77,15 +83,15 @@ jobs:

- name: "📊 Publish Test Report"
if: always()
uses: mikepenz/action-junit-report@v5
uses: mikepenz/action-junit-report@v6
with:
check_name: Java CI / Test Report (${{ matrix.java }})
report_paths: '**/build/test-results/test/TEST-*.xml'
check_retries: 'true'

- name: "📜 Upload binary compatibility check results"
if: matrix.java == '21'
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: binary-compatibility-reports
path: "**/build/reports/binary-compatibility-*.html"
Expand Down Expand Up @@ -113,3 +119,7 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs

- name: "❓ Optional cleanup step"
run: |
[ -f ./cleanup.sh ] && ./cleanup.sh || [ ! -f ./cleanup.sh ]
13 changes: 10 additions & 3 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,25 @@ jobs:
if: github.repository != 'micronaut-projects/micronaut-project-template'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Remove system JDKs
run: |
sudo rm -rf /usr/lib/jvm/*
unset JAVA_HOME
export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v '/usr/lib/jvm' | paste -sd:)
- uses: actions/checkout@v6
- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
java-version: |
21
25
- name: Publish to Sonatype Snapshots
if: success()
env:
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@ jobs:
artifacts-sha256: ${{ steps.hash.outputs.artifacts-sha256 }} # Computed hashes for build artifacts.
runs-on: ubuntu-latest
steps:
- name: Remove system JDKs
run: |
sudo rm -rf /usr/lib/jvm/*
unset JAVA_HOME
export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v '/usr/lib/jvm' | paste -sd:)
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
token: ${{ secrets.GH_TOKEN }}
- uses: gradle/actions/wrapper-validation@v4
- uses: gradle/actions/wrapper-validation@v5
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
java-version: |
21
25
- name: Set the current release version
id: release_version
run: echo "release_version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -66,13 +73,13 @@ jobs:
# Store the hash in a file, which is uploaded as a workflow artifact.
sha256sum $ARTIFACTS | base64 -w0 > artifacts-sha256
- name: Upload build artifacts
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: gradle-build-outputs
path: build/repo/${{ steps.publish.outputs.group }}/*/${{ steps.publish.outputs.version }}/*
retention-days: 5
- name: Upload artifacts-sha256
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: artifacts-sha256
path: artifacts-sha256
Expand All @@ -87,11 +94,14 @@ jobs:
GH_USERNAME: ${{ secrets.GH_USERNAME }}
- name: Export Gradle Properties
uses: micronaut-projects/github-actions/export-gradle-properties@master
- name: LATEST_TAG
run: |
echo "LATEST_TAG=$(curl -s -L -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name')" >> $GITHUB_ENV
- name: Publish to Github Pages
if: success()
uses: micronaut-projects/github-pages-deploy-action@master
env:
BETA: ${{ !(github.event.release.target_commitish == github.event.repository.default_branch) || contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }}
BETA: ${{ !(github.event.release.tag_name == env.LATEST_TAG) || github.event.release.draft || github.event.release.prerelease || contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
Expand All @@ -115,7 +125,7 @@ jobs:
artifacts-sha256: ${{ steps.set-hash.outputs.artifacts-sha256 }}
steps:
- name: Download artifacts-sha256
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: artifacts-sha256
# The SLSA provenance generator expects the hash digest of artifacts to be passed as a job
Expand Down Expand Up @@ -146,9 +156,9 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Download artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: gradle-build-outputs
path: build/repo
Expand All @@ -160,6 +170,6 @@ jobs:
- name: Upload assets
# Upload the artifacts to the existing release. Note that the SLSA provenance will
# attest to each artifact file and not the aggregated ZIP file.
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
files: artifacts.zip
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ src/main/docs/resources/img/micronaut-logo-white.svg

# Ignore files generated by test-resources
**/.micronaut/test-resources/

# Ignore gradle.properties generated by micronaut-build
/buildSrc/gradle.properties
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading