-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing of Keycloak admin client with Keycloak 24, 25 and nightly. GH…
… actions setup updates to allow caching closes keycloak/keycloak#31868 Signed-off-by: mposolda <[email protected]>
- Loading branch information
Showing
10 changed files
with
192 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build Keycloak Client | ||
description: Builds Keycloak client providing Maven repository with all artifacts | ||
|
||
inputs: | ||
upload-m2-repo: | ||
description: Upload Maven repository for org.keycloak artifacts | ||
required: false | ||
default: "true" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: setup-java | ||
name: Setup Java | ||
uses: ./.github/actions/java-setup | ||
|
||
- id: maven-cache | ||
name: Maven cache | ||
uses: ./.github/actions/maven-cache | ||
with: | ||
create-cache-if-it-doesnt-exist: true | ||
|
||
- id: build-keycloak-client | ||
name: Build Keycloak Client libraries | ||
shell: bash | ||
run: mvn -B clean install dependency:resolve -Pnightly -DskipTests=true | ||
|
||
- id: compress-keycloak-maven-repository | ||
name: Compress Keycloak Maven artifacts | ||
if: inputs.upload-m2-repo == 'true' | ||
shell: bash | ||
run: | | ||
tar -C ~/ --use-compress-program zstd -cf m2-keycloak.tzts \ | ||
--exclude '*.tar.gz' \ | ||
.m2/repository/org/keycloak | ||
- id: upload-keycloak-maven-repository | ||
name: Upload Keycloak Maven artifacts | ||
if: inputs.upload-m2-repo == 'true' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: m2-keycloak.tzts | ||
path: m2-keycloak.tzts | ||
retention-days: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Setup Java | ||
description: Sets up Java. | ||
|
||
inputs: | ||
distribution: | ||
description: Java distribution. | ||
required: false | ||
default: temurin | ||
java-version: | ||
description: The Java version that is going to be set up. | ||
required: false | ||
default: "21" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: setup-java | ||
name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ inputs.distribution }} | ||
java-version: ${{ inputs.java-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Maven Cache | ||
description: Caches Maven artifacts | ||
|
||
inputs: | ||
create-cache-if-it-doesnt-exist: | ||
description: > | ||
Only those callers which fill the cache with the right contents should set this to true to avoid creating a cache | ||
which contains too few or too many entries. | ||
required: false | ||
default: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: weekly-cache-key | ||
name: Key for weekly rotation of cache | ||
shell: bash | ||
run: echo "key=mvn-`date -u "+%Y-%U"`" >> $GITHUB_OUTPUT | ||
|
||
- id: cache-maven-repository | ||
name: Maven cache | ||
uses: actions/cache@v4 | ||
if: inputs.create-cache-if-it-doesnt-exist == 'true' | ||
with: | ||
# Two asterisks are needed to make the follow-up exclusion work | ||
# see https://github.com/actions/toolkit/issues/713 for the upstream issue | ||
path: | | ||
~/.m2/repository/*/* | ||
!~/.m2/repository/org/keycloak | ||
key: ${{ steps.weekly-cache-key.outputs.key }} | ||
|
||
- id: restore-maven-repository | ||
name: Maven cache | ||
uses: actions/cache/restore@v4 | ||
if: inputs.create-cache-if-it-doesnt-exist == 'false' | ||
with: | ||
# Two asterisks are needed to make the follow-up exclusion work | ||
# see https://github.com/actions/toolkit/issues/713 for the upstream issue | ||
path: | | ||
~/.m2/repository/*/* | ||
!~/.m2/repository/org/keycloak | ||
key: ${{ steps.weekly-cache-key.outputs.key }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Setup unit test | ||
description: Download Maven caches needed for unit tests | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Java | ||
uses: ./.github/actions/java-setup | ||
|
||
- id: maven-cache | ||
name: Maven cache | ||
uses: ./.github/actions/maven-cache | ||
|
||
- id: download-keycloak | ||
name: Download Keycloak Maven artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: m2-keycloak.tzts | ||
|
||
- id: extract-maven-artifacts | ||
name: Extract Keycloak Maven artifacts | ||
shell: bash | ||
run: | | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
choco install zstandard | ||
fi | ||
tar -C ~/ --use-compress-program="zstd -d" -xf m2-keycloak.tzts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters