-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,981 changed files
with
207,729 additions
and
0 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,53 @@ | ||
################################################################################################### | ||
# Overview | ||
# | ||
# Pattern used to match files follows most of the same rules as used in gitignore files. Order is | ||
# important; the last matching pattern takes precendence. | ||
# | ||
# For more info see: | ||
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | ||
################################################################################################### | ||
|
||
|
||
################################################################################################### | ||
# Global (@keycloak/maintainers) | ||
################################################################################################### | ||
|
||
* @keycloak/maintainers | ||
|
||
################################################################################################### | ||
# Testsuite | ||
################################################################################################### | ||
|
||
/testsuite/ @keycloak/core-maintainers @keycloak/cloud-native-maintainers @keycloak/store-maintainers | ||
|
||
################################################################################################### | ||
# Core (@keycloak/core-maintainers) | ||
################################################################################################### | ||
|
||
|
||
################################################################################################### | ||
# Cloud Native (@keycloak/cloud-native-maintainers) | ||
################################################################################################### | ||
|
||
/operator/ @keycloak/cloud-native-maintainers | ||
/quarkus/ @keycloak/cloud-native-maintainers | ||
/docs/guides/server/ @keycloak/cloud-native-maintainers | ||
/docs/guides/operator/ @keycloak/cloud-native-maintainers | ||
|
||
################################################################################################### | ||
# Store (@keycloak/store-maintainers) | ||
################################################################################################### | ||
|
||
/model/ @keycloak/store-maintainers | ||
/testsuite/model/ @keycloak/store-maintainers | ||
|
||
################################################################################################### | ||
# UI (@keycloak/ui-maintainers) | ||
################################################################################################### | ||
|
||
/js/ @keycloak/ui-maintainers | ||
/adapters/oidc/js/ @keycloak/ui-maintainers | ||
/rest/admin-ui-ext/ @keycloak/ui-maintainers | ||
/themes/src/main/resources/theme/keycloak.v2/account/ @keycloak/ui-maintainers | ||
/testsuite/integration-arquillian/tests/other/base-ui/ @keycloak/ui-maintainers |
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,79 @@ | ||
name: Build Keycloak | ||
description: Builds Keycloak providing Maven repository with all artifacts | ||
|
||
inputs: | ||
upload-m2-repo: | ||
description: Upload Maven repository for org.keycloak artifacts | ||
required: false | ||
default: true | ||
upload-dist: | ||
description: Upload distribution | ||
required: false | ||
default: false | ||
jdk-dist: | ||
description: JDK distribution | ||
required: false | ||
default: temurin | ||
jdk-version: | ||
description: JDK version | ||
required: false | ||
default: 17 | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: setup-java | ||
name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: ${{ inputs.jdk-dist }} | ||
java-version: ${{ inputs.jdk-version }} | ||
|
||
- id: maven-cache | ||
name: Maven cache | ||
uses: ./.github/actions/maven-cache | ||
with: | ||
create-cache-if-it-doesnt-exist: true | ||
|
||
- id: phantomjs-cache | ||
name: PhantomJS cache | ||
uses: ./.github/actions/phantomjs-cache | ||
|
||
- id: npm-cache | ||
name: NPM cache | ||
uses: ./.github/actions/npm-cache | ||
|
||
- id: build-keycloak | ||
name: Build Keycloak | ||
shell: bash | ||
# By using "dependency:resolve", it will download all dependencies used in later stages for running the tests | ||
run: | | ||
MVN_HTTP_CONFIG="-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120" | ||
./mvnw install dependency:resolve -nsu -B -e -DskipTests -DskipExamples $MVN_HTTP_CONFIG | ||
- 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@v3 | ||
with: | ||
name: m2-keycloak.tzts | ||
path: m2-keycloak.tzts | ||
retention-days: 1 | ||
|
||
- id: upload-keycloak-dist | ||
name: Upload Keycloak dist | ||
if: inputs.upload-dist == 'true' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: keycloak-dist | ||
path: quarkus/dist/target/keycloak*.tar.gz | ||
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,34 @@ | ||
name: Check if a job passed | ||
description: Fails if the job is required and was not successful | ||
|
||
inputs: | ||
required: | ||
description: Is the job required | ||
required: true | ||
default: true | ||
conclusion: | ||
description: Job conclusion (success if passed, most likely empty otherwise) | ||
required: true | ||
|
||
outputs: | ||
status: | ||
description: "Check status" | ||
value: ${{ steps.changes.outputs.java }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: check-job | ||
name: Check job | ||
shell: bash | ||
run: | | ||
if [ "${{ inputs.required }}" == "false" ]; then | ||
echo "Not required to run, skipping" | ||
else | ||
if [ "${{ inputs.conclusion }}" == "success" ]; then | ||
echo "Success" | ||
else | ||
echo "Required to run, but didn't succeed" | ||
exit 1 | ||
fi | ||
fi |
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,16 @@ | ||
name: Mark job as successful | ||
description: Workaround for GitHub Actions not setting conclusion on jobs passed through needs | ||
|
||
outputs: | ||
conclusion: | ||
description: Conclusion | ||
value: ${{ steps.check.outputs.conclusion }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: check | ||
name: Set success | ||
shell: bash | ||
run: | | ||
echo "conclusion=success" >> $GITHUB_OUTPUT |
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,30 @@ | ||
name: Changed Files | ||
description: Checks changes against target branch | ||
|
||
outputs: | ||
ci: | ||
description: Should "ci.yml" execute | ||
value: ${{ steps.changes.outputs.ci }} | ||
operator: | ||
description: Should "operator-ci.yml" execute | ||
value: ${{ steps.changes.outputs.operator }} | ||
js: | ||
description: Should "js-ci.yml" execute | ||
value: ${{ steps.changes.outputs.js }} | ||
codeql-java: | ||
description: Should "codeql-analysis.yml / java" execute | ||
value: ${{ steps.changes.outputs.codeql-java }} | ||
codeql-themes: | ||
description: Should "codeql-analysis.yml / themes" execute | ||
value: ${{ steps.changes.outputs.codeql-themes }} | ||
docs: | ||
description: Should "docs.yml" execute | ||
value: ${{ steps.changes.outputs.docs }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: changes | ||
name: Find changes | ||
shell: bash | ||
run: .github/actions/conditional/conditional.sh origin ${{ github.base_ref }} |
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,104 @@ | ||
#!/bin/bash -e | ||
|
||
REMOTE="$1" | ||
BASE_REF="$2" | ||
|
||
CONDITIONS_FILE=".github/actions/conditional/conditions" | ||
|
||
[ "$BASE_REF" != "" ] && IS_PR=true || IS_PR=false | ||
[ "$GITHUB_OUTPUT" != "" ] && IS_GITHUB_ACTIONS=true || IS_GITHUB_ACTIONS=false | ||
|
||
if [ "$IS_PR" == true ]; then | ||
# Fetch remote if running on GitHub Actions | ||
if [ "$IS_GITHUB_ACTIONS" == true ]; then | ||
echo "========================================================================================" | ||
echo "Fetching '$BASE_REF' in '$(git remote get-url "$REMOTE")'" | ||
echo "--------------------------------------------------------------------------------" | ||
git fetch --depth 1 "$REMOTE" "$BASE_REF" | ||
fi | ||
|
||
# Get list of changes files | ||
echo "========================================================================================" | ||
echo "Changes compared to '$BASE_REF' in '$(git remote get-url "$REMOTE")'" | ||
echo "----------------------------------------------------------------------------------------" | ||
CHANGED_FILES=$(git diff "$REMOTE/$BASE_REF" --name-only) | ||
echo "$CHANGED_FILES" | ||
fi | ||
|
||
echo "========================================================================================" | ||
if [ "$IS_PR" == true ]; then | ||
echo "Matching regex" | ||
echo "----------------------------------------------------------------------------------------" | ||
else | ||
echo "Not a pull request, marking everything as changed" | ||
fi | ||
|
||
declare -A JOB_CONDITIONS | ||
|
||
readarray -t CONDITIONS <<< "$(cat "$CONDITIONS_FILE" | grep -v '^[ ]*#' | grep -v '^[ ]*$')" | ||
|
||
for C in "${CONDITIONS[@]}"; do | ||
read -r -a CONDITION <<< "$C" | ||
|
||
if [ "$IS_PR" == true ]; then | ||
PATTERN="${CONDITION[0]}" | ||
|
||
# Convert pattern to regex | ||
REGEX="$PATTERN" | ||
#REGEX=$(echo "$PATTERN" | sed 's|\.|\\.|g' | sed 's|/$|/.*|g' | sed 's|^*|.*|g') | ||
|
||
# Escape '/' characters | ||
REGEX=$(echo "$REGEX" | sed 's|\/|\\/|g') | ||
|
||
# Escape '.' to make it match the '.' character only | ||
REGEX=$(echo "$REGEX" | sed 's|\.|\\.|g') | ||
|
||
# Convert '*' to match anything | ||
REGEX=$(echo "$REGEX" | sed 's|\*|.*|g') | ||
|
||
# If ends with directory seperator, allow anything within | ||
REGEX=$(echo "$REGEX" | sed 's|/$|/.*|g') | ||
|
||
# If no directory separators allow any directory structure before | ||
if ( echo "$REGEX" | grep -v -E '\/' &>/dev/null ); then | ||
REGEX="(.*\/)?$REGEX" | ||
fi | ||
|
||
# Check if changed files matches regex | ||
if ( echo "$CHANGED_FILES" | grep -q -E "^$REGEX$"); then | ||
RUN_JOB=true | ||
echo "* $REGEX" | ||
else | ||
RUN_JOB=false | ||
echo " $REGEX" | ||
fi | ||
else | ||
# Always run job if not a PR | ||
RUN_JOB=true | ||
fi | ||
|
||
# Set what jobs should run for the regex | ||
for ((i = 1; i < ${#CONDITION[@]}; i++)); do | ||
JOB=${CONDITION[$i]} | ||
|
||
# If already set to run, ignore | ||
if [ "${JOB_CONDITIONS[$JOB]}" != true ]; then | ||
JOB_CONDITIONS[$JOB]=$RUN_JOB | ||
fi | ||
done | ||
done | ||
|
||
echo "========================================================================================" | ||
echo "Run workflows/jobs" | ||
echo "----------------------------------------------------------------------------------------" | ||
|
||
# List all jobs and if they should run or not | ||
for JOB in "${!JOB_CONDITIONS[@]}" | ||
do | ||
echo "$JOB=${JOB_CONDITIONS[$JOB]}" | ||
|
||
# Set output for GitHub job | ||
if [ "$IS_GITHUB_ACTIONS" == true ]; then | ||
echo "$JOB=${JOB_CONDITIONS[$JOB]}" >> $GITHUB_OUTPUT | ||
fi | ||
done |
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,21 @@ | ||
# File patterns used to decide what workflows/jobs to execute for a given PR | ||
# | ||
# To test a pattern run '.github/actions/conditional/conditional.sh <remote name> <branch>' | ||
|
||
.github/actions/ ci operator js codeql-java codeql-themes | ||
|
||
.github/workflows/ci.yml ci | ||
.github/workflows/operator-ci.yml operator | ||
.github/workflows/js-ci.yml js | ||
.github/workflows/codeql-analysis.yml codeql-java codeql-themes | ||
|
||
*/src/main/ ci operator | ||
*/src/test/ ci operator | ||
pom.xml ci operator | ||
|
||
docs/guides/ docs | ||
|
||
js/ js | ||
|
||
*.java codeql-java | ||
themes/ codeql-themes |
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,41 @@ | ||
name: Setup integration test | ||
description: Download Maven caches needed for integration tests | ||
|
||
inputs: | ||
jdk-dist: | ||
description: JDK distribution | ||
required: false | ||
default: temurin | ||
jdk-version: | ||
description: JDK version | ||
required: false | ||
default: 17 | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: setup-java | ||
name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: ${{ inputs.jdk-dist }} | ||
java-version: ${{ inputs.jdk-version }} | ||
|
||
- id: maven-cache | ||
name: Maven cache | ||
uses: ./.github/actions/maven-cache | ||
|
||
- id: phantomjs-cache | ||
name: PhantomJS cache | ||
uses: ./.github/actions/phantomjs-cache | ||
|
||
- id: download-keycloak | ||
name: Download Keycloak Maven artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: m2-keycloak.tzts | ||
|
||
- id: extract-maven-artifacts | ||
name: Extract Keycloak Maven artifacts | ||
shell: bash | ||
run: tar -C ~/ --use-compress-program unzstd -xf m2-keycloak.tzts |
Oops, something went wrong.