2020-05-14 13:49:00 +00:00
name : Keycloak CI
2022-03-29 13:10:20 +00:00
on :
push :
branches-ignore : [ main]
2022-07-28 18:30:05 +00:00
# as the ci.yml contains actions that are required for PRs to be merged, it will always need to run on all PRs
pull_request : {}
2022-03-29 13:10:20 +00:00
schedule :
2022-11-02 11:36:43 +00:00
- cron : '0 20,22,0,2,4 * * *'
2022-09-12 09:19:23 +00:00
workflow_dispatch :
2020-05-14 13:49:00 +00:00
2021-08-04 15:04:26 +00:00
env :
DEFAULT_JDK_VERSION : 11
2021-11-29 12:28:04 +00:00
concurrency :
# Only run once for latest commit per ref and cancel other (previous) runs.
2022-07-28 18:30:05 +00:00
group : ${{ github.workflow }}-${{ github.ref }}
2021-11-29 12:28:04 +00:00
cancel-in-progress : true
2020-05-14 13:49:00 +00:00
jobs :
build :
name : Build
2022-03-29 13:10:20 +00:00
if : ${{ ( github.event_name != 'schedule' ) || ( github.event_name == 'schedule' && github.repository == 'keycloak/keycloak' ) }}
2020-05-14 13:49:00 +00:00
runs-on : ubuntu-latest
steps :
2022-03-28 15:51:51 +00:00
- uses : actions/checkout@v3
2022-04-14 08:52:59 +00:00
- uses : actions/setup-java@v3
2020-05-14 13:49:00 +00:00
with :
2022-03-30 15:45:31 +00:00
distribution : 'temurin'
2021-08-04 15:04:26 +00:00
java-version : ${{ env.DEFAULT_JDK_VERSION }}
2022-04-14 14:42:47 +00:00
cache : 'maven'
2021-05-18 16:04:36 +00:00
- name : Update maven settings
run : mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
2020-11-05 14:35:47 +00:00
- name : Build Keycloak
2020-11-13 14:15:01 +00:00
run : |
2022-04-22 13:24:39 +00:00
./mvnw clean install -nsu -B -e -DskipTests -Pdistribution
./mvnw clean install -nsu -B -e -f testsuite/integration-arquillian/servers/auth-server -Pauth-server-quarkus
./mvnw clean install -nsu -B -e -f testsuite/integration-arquillian/servers/auth-server -Pauth-server-undertow
2020-05-14 13:49:00 +00:00
2020-11-05 14:35:47 +00:00
- name : Store Keycloak artifacts
id : store-keycloak
2022-03-28 15:51:51 +00:00
uses : actions/upload-artifact@v3
2020-11-05 14:35:47 +00:00
with :
name : keycloak-artifacts.zip
2021-11-26 15:51:59 +00:00
retention-days : 1
2020-11-05 14:35:47 +00:00
path : |
~/.m2/repository/org/keycloak
!~/.m2/repository/org/keycloak/**/*.tar.gz
2020-11-10 09:40:06 +00:00
- name : Remove keycloak artifacts before caching
if : steps.cache.outputs.cache-hit != 'true'
run : rm -rf ~/.m2/repository/org/keycloak
2020-11-13 14:15:01 +00:00
# Tests: Regular distribution
2020-11-05 14:35:47 +00:00
2020-11-04 06:57:19 +00:00
unit-tests :
name : Unit Tests
runs-on : ubuntu-latest
2020-11-05 09:23:15 +00:00
needs : build
2022-10-27 08:43:51 +00:00
timeout-minutes : 20
2020-11-04 06:57:19 +00:00
steps :
2022-03-28 15:51:51 +00:00
- uses : actions/checkout@v3
2022-04-14 08:52:59 +00:00
- uses : actions/setup-java@v3
2020-11-04 06:57:19 +00:00
with :
2022-03-30 15:45:31 +00:00
distribution : 'temurin'
2021-08-04 15:04:26 +00:00
java-version : ${{ env.DEFAULT_JDK_VERSION }}
2022-04-14 14:42:47 +00:00
cache : 'maven'
2021-05-18 16:04:36 +00:00
- name : Update maven settings
run : mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
2020-11-10 09:40:06 +00:00
- name : Cleanup org.keycloak artifacts
run : rm -rf ~/.m2/repository/org/keycloak >/dev/null || true
2020-11-05 14:35:47 +00:00
- name : Download built keycloak
id : download-keycloak
2022-03-28 15:51:51 +00:00
uses : actions/download-artifact@v3
2020-11-05 14:35:47 +00:00
with :
2020-11-10 09:40:06 +00:00
path : ~/.m2/repository/org/keycloak/
2020-11-05 14:35:47 +00:00
name : keycloak-artifacts.zip
2020-11-04 06:57:19 +00:00
- name : Run unit tests
2020-11-05 14:35:47 +00:00
run : |
2022-04-22 13:24:39 +00:00
if ! ./mvnw install -nsu -B -DskipTestsuite -DskipQuarkus -DskipExamples -f pom.xml; then
2020-11-13 14:15:01 +00:00
find . -path '*/target/surefire-reports/*.xml' | zip -q reports-unit-tests.zip -@
exit 1
fi
2020-11-05 14:35:47 +00:00
2022-09-12 09:19:23 +00:00
- name : Analyze Test and/or Coverage Results
2022-11-03 06:08:57 +00:00
uses : runforesight/foresight-test-kit-action@v1.3.0
2022-10-05 05:47:53 +00:00
if : always() && github.repository == 'keycloak/keycloak'
2022-09-12 09:19:23 +00:00
with :
api_key : ${{ secrets.FORESIGHT_API_KEY }}
test_format : JUNIT
test_framework : JUNIT
test_path : '**/target/surefire-reports/*.xml'
2020-11-05 14:35:47 +00:00
- name : Unit test reports
2022-03-28 15:51:51 +00:00
uses : actions/upload-artifact@v3
2020-11-05 14:35:47 +00:00
if : failure()
with :
2020-11-13 07:46:30 +00:00
name : reports-unit-tests
2020-11-05 14:35:47 +00:00
retention-days : 14
path : reports-unit-tests.zip
2020-11-10 09:40:06 +00:00
if-no-files-found : ignore
2020-11-04 06:57:19 +00:00
2022-09-02 14:45:01 +00:00
crypto-tests :
name : Crypto Tests
runs-on : ubuntu-latest
needs : build
2022-10-27 08:43:51 +00:00
timeout-minutes : 20
2022-09-02 14:45:01 +00:00
steps :
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : ${{ env.DEFAULT_JDK_VERSION }}
cache : 'maven'
- name : Update maven settings
run : mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name : Cleanup org.keycloak artifacts
run : rm -rf ~/.m2/repository/org/keycloak >/dev/null || true
- name : Download built keycloak
id : download-keycloak
uses : actions/download-artifact@v3
with :
path : ~/.m2/repository/org/keycloak/
name : keycloak-artifacts.zip
- name : Run crypto tests (BCFIPS non-approved mode)
run : |
if ! ./mvnw install -nsu -B -f crypto/pom.xml -Dcom.redhat.fips=true; then
find . -path 'crypto/target/surefire-reports/*.xml' | zip -q reports-crypto-tests.zip -@
exit 1
fi
- name : Run crypto tests (BCFIPS approved mode)
run : |
if ! ./mvnw install -nsu -B -f crypto/pom.xml -Dcom.redhat.fips=true -Dorg.bouncycastle.fips.approved_only=true; then
find . -path 'crypto/target/surefire-reports/*.xml' | zip -q reports-crypto-tests.zip -@
exit 1
fi
- name : Crypto test reports
uses : actions/upload-artifact@v3
if : failure()
with :
name : reports-crypto-tests
retention-days : 14
path : reports-crypto-tests.zip
if-no-files-found : ignore
2020-11-30 07:53:31 +00:00
model-tests :
name : Model Tests
runs-on : ubuntu-latest
needs : build
2022-10-27 08:43:51 +00:00
timeout-minutes : 60
2020-11-30 07:53:31 +00:00
steps :
2022-03-28 15:51:51 +00:00
- uses : actions/checkout@v3
2022-04-14 08:52:59 +00:00
- uses : actions/setup-java@v3
2020-11-30 07:53:31 +00:00
with :
2022-03-30 15:45:31 +00:00
distribution : 'temurin'
2021-08-04 15:04:26 +00:00
java-version : ${{ env.DEFAULT_JDK_VERSION }}
2022-04-14 14:42:47 +00:00
cache : 'maven'
2021-05-18 16:04:36 +00:00
- name : Update maven settings
run : mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
2020-11-30 07:53:31 +00:00
- name : Cleanup org.keycloak artifacts
run : rm -rf ~/.m2/repository/org/keycloak >/dev/null || true
- name : Download built keycloak
id : download-keycloak
2022-03-28 15:51:51 +00:00
uses : actions/download-artifact@v3
2020-11-30 07:53:31 +00:00
with :
path : ~/.m2/repository/org/keycloak/
name : keycloak-artifacts.zip
- name : Run model tests
run : |
if ! testsuite/model/test-all-profiles.sh; then
find . -path '*/target/surefire-reports*/*.xml' | zip -q reports-model-tests.zip -@
exit 1
fi
2022-09-12 09:19:23 +00:00
- name : Analyze Test and/or Coverage Results
2022-11-03 06:08:57 +00:00
uses : runforesight/foresight-test-kit-action@v1.3.0
2022-10-05 05:47:53 +00:00
if : always() && github.repository == 'keycloak/keycloak'
2022-09-12 09:19:23 +00:00
with :
api_key : ${{ secrets.FORESIGHT_API_KEY }}
test_format : JUNIT
test_framework : JUNIT
test_path : 'testsuite/model/target/surefire-reports/*.xml'
2020-11-30 07:53:31 +00:00
- name : Model test reports
2022-03-28 15:51:51 +00:00
uses : actions/upload-artifact@v3
2020-11-30 07:53:31 +00:00
if : failure()
with :
name : reports-model-tests
retention-days : 14
path : reports-model-tests.zip
if-no-files-found : ignore
2020-05-14 13:49:00 +00:00
test :
2020-11-13 14:15:01 +00:00
name : Base testsuite
2020-05-14 13:49:00 +00:00
needs : build
runs-on : ubuntu-latest
2022-10-27 08:43:51 +00:00
timeout-minutes : 70
2020-11-13 14:15:01 +00:00
strategy :
matrix :
2022-08-26 07:57:54 +00:00
server : [ 'quarkus' , 'quarkus-map' , 'quarkus-map-hot-rod' ]
2020-11-13 14:15:01 +00:00
tests : [ 'group1' , 'group2' , 'group3' ]
fail-fast : false
2020-05-14 13:49:00 +00:00
steps :
2022-03-28 15:51:51 +00:00
- uses : actions/checkout@v3
2021-08-17 11:30:52 +00:00
with :
fetch-depth : 2
- name : Check whether HEAD^ contains HotRod storage relevant changes
2022-05-19 08:55:53 +00:00
run : echo "GIT_HOTROD_RELEVANT_DIFF=$( git diff --name-only HEAD^ | egrep -ic -e '^model/map-hot-rod|^model/map/|^model/build-processor' )" >> $GITHUB_ENV
2020-11-05 09:23:15 +00:00
- name : Cache Maven packages
2022-08-26 07:57:54 +00:00
if : ${{ github.event_name != 'pull_request' || matrix.server != 'quarkus-map-hot-rod' || env.GIT_HOTROD_RELEVANT_DIFF != 0 }}
2022-03-28 15:51:51 +00:00
uses : actions/cache@v3
2020-11-05 09:23:15 +00:00
with :
2020-11-10 09:40:06 +00:00
path : ~/.m2/repository
2022-02-16 07:59:05 +00:00
key : cache-2-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
2020-11-10 09:40:06 +00:00
restore-keys : cache-1-${{ runner.os }}-m2
2020-11-05 14:35:47 +00:00
- name : Download built keycloak
2022-08-26 07:57:54 +00:00
if : ${{ github.event_name != 'pull_request' || matrix.server != 'quarkus-map-hot-rod' || env.GIT_HOTROD_RELEVANT_DIFF != 0 }}
2020-11-05 14:35:47 +00:00
id : download-keycloak
2022-03-28 15:51:51 +00:00
uses : actions/download-artifact@v3
2020-11-05 14:35:47 +00:00
with :
2020-11-10 09:40:06 +00:00
path : ~/.m2/repository/org/keycloak/
2020-11-05 14:35:47 +00:00
name : keycloak-artifacts.zip
2020-11-05 09:23:15 +00:00
2020-11-10 09:40:06 +00:00
# - name: List M2 repo
# run: |
# find ~ -name *dist*.zip
# ls -lR ~/.m2/repository
2022-04-14 08:52:59 +00:00
- uses : actions/setup-java@v3
2022-08-26 07:57:54 +00:00
if : ${{ github.event_name != 'pull_request' || matrix.server != 'quarkus-map-hot-rod' || env.GIT_HOTROD_RELEVANT_DIFF != 0 }}
2020-05-14 13:49:00 +00:00
with :
2022-03-30 15:45:31 +00:00
distribution : 'temurin'
2021-08-04 15:04:26 +00:00
java-version : ${{ env.DEFAULT_JDK_VERSION }}
2021-05-18 16:04:36 +00:00
- name : Update maven settings
2022-08-26 07:57:54 +00:00
if : ${{ github.event_name != 'pull_request' || matrix.server != 'quarkus-map-hot-rod' || env.GIT_HOTROD_RELEVANT_DIFF != 0 }}
2021-05-18 16:04:36 +00:00
run : mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
2022-08-03 18:34:12 +00:00
- name : Prepare test providers
if : ${{ matrix.server == 'quarkus' || matrix.server == 'quarkus-map' }}
run : ./mvnw clean install -nsu -B -e -f testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers -Pauth-server-quarkus
2020-05-14 13:49:00 +00:00
- name : Run base tests
2022-08-26 07:57:54 +00:00
if : ${{ github.event_name != 'pull_request' || matrix.server != 'quarkus-map-hot-rod' || env.GIT_HOTROD_RELEVANT_DIFF != 0 }}
2020-11-05 09:23:15 +00:00
run : |
2020-11-13 14:15:01 +00:00
declare -A PARAMS TESTGROUP
PARAMS["quarkus"]="-Pauth-server-quarkus"
2022-07-20 10:27:19 +00:00
PARAMS["quarkus-map"]="-Pauth-server-quarkus -Pmap-storage -Dpageload.timeout=90000"
2022-08-26 07:57:54 +00:00
PARAMS["quarkus-map-hot-rod"]="-Pauth-server-quarkus -Pmap-storage,map-storage-hot-rod -Dpageload.timeout=90000"
2020-11-13 14:15:01 +00:00
TESTGROUP["group1"]="-Dtest=!**.crossdc.**,!**.cluster.**,%regex[org.keycloak.testsuite.(a[abc]|ad[a-l]|[^a-q]).*]" # Tests alphabetically before admin tests and those after "r"
2022-05-19 08:55:53 +00:00
TESTGROUP["group2"]="-Dtest=!**.crossdc.**,!**.cluster.**,%regex[org.keycloak.testsuite.(ad[^a-l]|a[^a-d]|b).*]" # Admin tests and those starting with "b"
TESTGROUP["group3"]="-Dtest=!**.crossdc.**,!**.cluster.**,%regex[org.keycloak.testsuite.([c-q]).*]" # All the rest
./mvnw clean install -nsu -B ${PARAMS["${{ matrix.server }}"]} ${TESTGROUP["${{ matrix.tests }}"]} -f testsuite/integration-arquillian/tests/base/pom.xml | misc/log/trimmer.sh
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip -q reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}.zip -@
exit $TEST_RESULT
2022-09-12 09:19:23 +00:00
- name : Analyze Test and/or Coverage Results
2022-11-03 06:08:57 +00:00
uses : runforesight/foresight-test-kit-action@v1.3.0
2022-10-05 05:47:53 +00:00
if : always() && github.repository == 'keycloak/keycloak'
2022-09-12 09:19:23 +00:00
with :
api_key : ${{ secrets.FORESIGHT_API_KEY }}
test_format : JUNIT
test_framework : JUNIT
test_path : 'testsuite/integration-arquillian/tests/base/target/surefire-reports/*.xml'
2022-05-19 08:55:53 +00:00
- name : Base test reports
uses : actions/upload-artifact@v3
if : failure()
with :
name : reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}
retention-days : 14
path : reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}.zip
if-no-files-found : ignore
2022-10-17 21:33:22 +00:00
test-fips :
name : Base testsuite (fips)
needs : build
runs-on : ubuntu-latest
2022-10-27 08:43:51 +00:00
timeout-minutes : 30
2022-10-17 21:33:22 +00:00
strategy :
matrix :
server : [ 'bcfips-nonapproved-pkcs12' ]
tests : [ 'group1' ]
fail-fast : false
steps :
- uses : actions/checkout@v3
with :
fetch-depth : 2
- name : Cache Maven packages
uses : actions/cache@v3
with :
path : ~/.m2/repository
key : cache-2-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys : cache-1-${{ runner.os }}-m2
- name : Download built keycloak
id : download-keycloak
uses : actions/download-artifact@v3
with :
path : ~/.m2/repository/org/keycloak/
name : keycloak-artifacts.zip
# - name: List M2 repo
# run: |
# find ~ -name *dist*.zip
# ls -lR ~/.m2/repository
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : ${{ env.DEFAULT_JDK_VERSION }}
- name : Update maven settings
run : mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name : Prepare quarkus distribution with BCFIPS
run : ./mvnw clean install -nsu -B -e -f testsuite/integration-arquillian/servers/auth-server/quarkus -Pauth-server-quarkus,auth-server-fips140-2
- name : Run base tests
run : |
declare -A PARAMS TESTGROUP
PARAMS["bcfips-nonapproved-pkcs12"]="-Pauth-server-quarkus,auth-server-fips140-2"
2022-10-19 09:13:29 +00:00
# Tests in the package "forms" and some keystore related tests
TESTGROUP["group1"]="-Dtest=org.keycloak.testsuite.forms.**,ClientAuthSignedJWTTest,CredentialsTest,JavaKeystoreKeyProviderTest,ServerInfoTest"
2022-10-17 21:33:22 +00:00
./mvnw clean install -nsu -B ${PARAMS["${{ matrix.server }}"]} ${TESTGROUP["${{ matrix.tests }}"]} -f testsuite/integration-arquillian/tests/base/pom.xml | misc/log/trimmer.sh
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip -q reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}.zip -@
exit $TEST_RESULT
- name : Analyze Test and/or Coverage Results
2022-11-03 06:08:57 +00:00
uses : runforesight/foresight-test-kit-action@v1.3.0
2022-10-17 21:33:22 +00:00
if : always() && github.repository == 'keycloak/keycloak'
with :
api_key : ${{ secrets.FORESIGHT_API_KEY }}
test_format : JUNIT
test_framework : JUNIT
test_path : 'testsuite/integration-arquillian/tests/base/target/surefire-reports/*.xml'
- name : Base test reports
uses : actions/upload-artifact@v3
if : failure()
with :
name : reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}
retention-days : 14
path : reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}.zip
if-no-files-found : ignore
2022-05-19 08:55:53 +00:00
test-posgres :
name : Base testsuite (postgres)
needs : build
runs-on : ubuntu-latest
2022-10-27 08:43:51 +00:00
timeout-minutes : 80
2022-05-19 08:55:53 +00:00
strategy :
matrix :
server : [ 'undertow-map-jpa' ]
tests : [ 'group1' , 'group2' , 'group3' ]
fail-fast : false
services :
# Label used to access the service container
postgres :
# Docker Hub image
image : postgres
env :
# Provide env variables for the image
POSTGRES_DB : keycloak
POSTGRES_USER : keycloak
POSTGRES_PASSWORD : pass
# Set health checks to wait until postgres has started
options : >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports :
# Maps tcp port 5432 on service container to the host
- 5432 : 5432
steps :
- uses : actions/checkout@v3
with :
fetch-depth : 2
- name : Check whether HEAD^ contains JPA map storage relevant changes
run : echo "GIT_MAP_JPA_RELEVANT_DIFF=$( git diff --name-only HEAD^ | egrep -ic -e '^model/map-jpa/|^model/map/|^model/build-processor' )" >> $GITHUB_ENV
- name : Cache Maven packages
if : ${{ github.event_name != 'pull_request' || env.GIT_MAP_JPA_RELEVANT_DIFF != 0 }}
uses : actions/cache@v3
with :
path : ~/.m2/repository
key : cache-2-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys : cache-1-${{ runner.os }}-m2
- name : Download built keycloak
if : ${{ github.event_name != 'pull_request' || env.GIT_MAP_JPA_RELEVANT_DIFF != 0 }}
id : download-keycloak
uses : actions/download-artifact@v3
with :
path : ~/.m2/repository/org/keycloak/
name : keycloak-artifacts.zip
- uses : actions/setup-java@v3
if : ${{ github.event_name != 'pull_request' || env.GIT_MAP_JPA_RELEVANT_DIFF != 0 }}
with :
distribution : 'temurin'
java-version : ${{ env.DEFAULT_JDK_VERSION }}
- name : Update maven settings
if : ${{ github.event_name != 'pull_request' || env.GIT_MAP_JPA_RELEVANT_DIFF != 0 }}
run : mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name : Run base tests
if : ${{ github.event_name != 'pull_request' || env.GIT_MAP_JPA_RELEVANT_DIFF != 0 }}
run : |
declare -A PARAMS TESTGROUP
PARAMS["undertow-map-jpa"]="-Pmap-storage,map-storage-jpa -Dpageload.timeout=90000"
TESTGROUP["group1"]="-Dtest=!**.crossdc.**,!**.cluster.**,%regex[org.keycloak.testsuite.(a[abc]|ad[a-l]|[^a-q]).*]" # Tests alphabetically before admin tests and those after "r"
2020-11-13 14:15:01 +00:00
TESTGROUP["group2"]="-Dtest=!**.crossdc.**,!**.cluster.**,%regex[org.keycloak.testsuite.(ad[^a-l]|a[^a-d]|b).*]" # Admin tests and those starting with "b"
TESTGROUP["group3"]="-Dtest=!**.crossdc.**,!**.cluster.**,%regex[org.keycloak.testsuite.([c-q]).*]" # All the rest
2022-04-22 13:24:39 +00:00
./mvnw clean install -nsu -B ${PARAMS["${{ matrix.server }}"]} ${TESTGROUP["${{ matrix.tests }}"]} -f testsuite/integration-arquillian/tests/base/pom.xml | misc/log/trimmer.sh
2020-11-13 14:15:01 +00:00
2020-11-05 14:35:47 +00:00
TEST_RESULT=${PIPESTATUS[0]}
2020-11-13 14:15:01 +00:00
find . -path '*/target/surefire-reports/*.xml' | zip -q reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}.zip -@
2020-11-05 14:35:47 +00:00
exit $TEST_RESULT
2022-09-12 09:19:23 +00:00
- name : Analyze Test and/or Coverage Results
2022-11-03 06:08:57 +00:00
uses : runforesight/foresight-test-kit-action@v1.3.0
2022-10-05 05:47:53 +00:00
if : always() && github.repository == 'keycloak/keycloak'
2022-09-12 09:19:23 +00:00
with :
api_key : ${{ secrets.FORESIGHT_API_KEY }}
test_format : JUNIT
test_framework : JUNIT
test_path : 'testsuite/integration-arquillian/tests/base/target/surefire-reports/*.xml'
2020-11-05 14:35:47 +00:00
- name : Base test reports
2022-03-28 15:51:51 +00:00
uses : actions/upload-artifact@v3
2020-11-05 14:35:47 +00:00
if : failure()
with :
2020-11-13 14:15:01 +00:00
name : reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}
2020-11-05 14:35:47 +00:00
retention-days : 14
2020-11-13 14:15:01 +00:00
path : reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}.zip
2020-11-10 09:40:06 +00:00
if-no-files-found : ignore
2020-11-04 06:57:19 +00:00
2020-11-05 14:35:47 +00:00
### Tests: Quarkus distribution
quarkus-test-cluster :
name : Quarkus Test Clustering
needs : build
runs-on : ubuntu-latest
2022-10-27 08:43:51 +00:00
timeout-minutes : 35
2020-11-05 14:35:47 +00:00
env :
2021-04-15 10:53:48 +00:00
MAVEN_OPTS : -Xmx1024m
2020-11-05 14:35:47 +00:00
steps :
2022-03-28 15:51:51 +00:00
- uses : actions/checkout@v3
2022-04-14 14:42:47 +00:00
- uses : actions/setup-java@v3
2020-11-05 14:35:47 +00:00
with :
2022-04-14 14:42:47 +00:00
distribution : 'temurin'
java-version : ${{ env.DEFAULT_JDK_VERSION }}
cache : 'maven'
2020-11-10 09:40:06 +00:00
- name : Cleanup org.keycloak artifacts
run : rm -rf ~/.m2/repository/org/keycloak >/dev/null || true
2020-11-05 14:35:47 +00:00
- name : Download built keycloak
id : download-keycloak
2022-03-28 15:51:51 +00:00
uses : actions/download-artifact@v3
2020-11-05 14:35:47 +00:00
with :
2020-11-10 09:40:06 +00:00
path : ~/.m2/repository/org/keycloak/
2020-11-05 14:35:47 +00:00
name : keycloak-artifacts.zip
2022-04-14 08:52:59 +00:00
- uses : actions/setup-java@v3
2020-11-05 14:35:47 +00:00
with :
2022-03-30 15:45:31 +00:00
distribution : 'temurin'
2021-08-04 15:04:26 +00:00
java-version : ${{ env.DEFAULT_JDK_VERSION }}
2021-05-18 16:04:36 +00:00
- name : Update maven settings
run : mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
2020-11-10 09:40:06 +00:00
- name : Run Quarkus cluster tests
2020-11-05 14:35:47 +00:00
run : |
2020-11-10 09:40:06 +00:00
echo '::group::Compiling testsuite'
2022-04-22 13:24:39 +00:00
./mvnw clean install -nsu -B -Pauth-server-quarkus -DskipTests -f testsuite/pom.xml
2020-11-10 09:40:06 +00:00
echo '::endgroup::'
2022-06-21 07:18:40 +00:00
./mvnw clean install -nsu -B -Pauth-server-cluster-quarkus -Dsession.cache.owners=2 -Dtest=**.cluster.** -f testsuite/integration-arquillian/pom.xml | misc/log/trimmer.sh
2020-11-05 14:35:47 +00:00
TEST_RESULT=${PIPESTATUS[0]}
2020-11-13 07:46:30 +00:00
find . -path '*/target/surefire-reports/*.xml' | zip -q reports-quarkus-cluster-tests.zip -@
2020-11-05 14:35:47 +00:00
exit $TEST_RESULT
2022-09-12 09:19:23 +00:00
- name : Analyze Test and/or Coverage Results
2022-11-03 06:08:57 +00:00
uses : runforesight/foresight-test-kit-action@v1.3.0
2022-10-05 05:47:53 +00:00
if : always() && github.repository == 'keycloak/keycloak'
2022-09-12 09:19:23 +00:00
with :
api_key : ${{ secrets.FORESIGHT_API_KEY }}
test_format : JUNIT
test_framework : JUNIT
test_path : 'testsuite/integration-arquillian/tests/base/target/surefire-reports/*.xml'
2020-11-10 09:40:06 +00:00
- name : Quarkus cluster test reports
2022-03-28 15:51:51 +00:00
uses : actions/upload-artifact@v3
2020-11-05 14:35:47 +00:00
if : failure()
with :
2020-11-13 07:46:30 +00:00
name : reports-quarkus-cluster-tests
2020-11-05 14:35:47 +00:00
retention-days : 14
2020-11-10 09:40:06 +00:00
path : reports-quarkus-cluster-tests.zip
if-no-files-found : ignore
2021-04-13 15:28:34 +00:00
2021-11-23 14:45:46 +00:00
### Tests: Quarkus distribution
quarkus-tests :
name : Quarkus Tests
needs : build
runs-on : ubuntu-latest
2022-10-27 08:43:51 +00:00
timeout-minutes : 100
2021-11-23 14:45:46 +00:00
env :
MAVEN_OPTS : -Xmx1024m
steps :
2022-03-28 15:51:51 +00:00
- uses : actions/checkout@v3
2022-04-14 14:42:47 +00:00
- uses : actions/setup-java@v3
2021-11-23 14:45:46 +00:00
with :
2022-04-14 14:42:47 +00:00
distribution : 'temurin'
java-version : ${{ env.DEFAULT_JDK_VERSION }}
2022-06-23 13:44:04 +00:00
cache : 'maven'
2021-11-23 14:45:46 +00:00
- name : Cleanup org.keycloak artifacts
run : rm -rf ~/.m2/repository/org/keycloak >/dev/null || true
- name : Download built keycloak
id : download-keycloak
2022-03-28 15:51:51 +00:00
uses : actions/download-artifact@v3
2021-11-23 14:45:46 +00:00
with :
path : ~/.m2/repository/org/keycloak/
name : keycloak-artifacts.zip
- name : Update maven settings
run : mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
2021-11-29 12:28:04 +00:00
- name : Prepare the local distribution archives
2022-04-22 13:24:39 +00:00
run : ./mvnw clean install -DskipTests -Pdistribution
2021-11-29 12:28:04 +00:00
- name : Run Quarkus Integration Tests
2021-11-23 14:45:46 +00:00
run : |
2022-04-22 13:24:39 +00:00
./mvnw clean install -nsu -B -f quarkus/tests/pom.xml | misc/log/trimmer.sh
2021-12-21 16:45:16 +00:00
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip -q reports-quarkus-tests.zip -@
exit $TEST_RESULT
- name : Run Quarkus Storage Tests
run : |
2022-07-28 11:00:11 +00:00
./mvnw clean install -nsu -B -f quarkus/tests/pom.xml -Ptest-database -Dtest=PostgreSQLDistTest,MariaDBDistTest#testSuccessful,MySQLDistTest#testSuccessful,DatabaseOptionsDistTest,JPAStoreDistTest,HotRodStoreDistTest,MixedStoreDistTest | misc/log/trimmer.sh
2021-11-23 14:45:46 +00:00
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip -q reports-quarkus-tests.zip -@
exit $TEST_RESULT
2022-02-01 13:08:44 +00:00
- name : Run Quarkus Tests in Docker
run : |
2022-04-22 13:24:39 +00:00
./mvnw clean install -nsu -B -f quarkus/tests/pom.xml -Dkc.quarkus.tests.dist=docker | misc/log/trimmer.sh
2022-02-01 13:08:44 +00:00
TEST_RESULT=${PIPESTATUS[0]}
exit $TEST_RESULT
2022-09-12 09:19:23 +00:00
- name : Analyze Test and/or Coverage Results
2022-11-03 06:08:57 +00:00
uses : runforesight/foresight-test-kit-action@v1.3.0
2022-10-05 05:47:53 +00:00
if : always() && github.repository == 'keycloak/keycloak'
2022-09-12 09:19:23 +00:00
with :
api_key : ${{ secrets.FORESIGHT_API_KEY }}
test_format : JUNIT
test_framework : JUNIT
test_path : 'quarkus/tests/integration/target/surefire-reports/*.xml'
2021-11-23 14:45:46 +00:00
- name : Quarkus test reports
2022-03-28 15:51:51 +00:00
uses : actions/upload-artifact@v3
2021-11-23 14:45:46 +00:00
if : failure()
with :
name : reports-quarkus-tests
retention-days : 14
path : reports-quarkus-tests.zip
if-no-files-found : ignore
2022-08-19 13:59:17 +00:00
# NOTE: WebAuthn tests can be enabled once the issue #12621 is resolved
#
# webauthn-test:
# name: WebAuthn Tests
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 2
#
# - name: Check whether this phase should run
# run: echo "GIT_DIFF=$[ $( git diff --name-only HEAD^ | egrep -ic 'webauthn|passwordless' ) ]" >> $GITHUB_ENV
#
# - uses: actions/setup-java@v1
# if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
# with:
# java-version: ${{ env.DEFAULT_JDK_VERSION }}
#
# - name: Update maven settings
# if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
# run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
#
# - name: Cache Maven packages
# if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
# uses: actions/cache@v2
# with:
# path: ~/.m2/repository
# key: cache-1-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: cache-1-${{ runner.os }}-m2
#
# - name: Cleanup org.keycloak artifacts
# if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
# run: rm -rf ~/.m2/repository/org/keycloak >/dev/null || true
#
# - name: Download built keycloak
# if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
# id: download-keycloak
# uses: actions/download-artifact@v2
# with:
# path: ~/.m2/repository/org/keycloak/
# name: keycloak-artifacts.zip
#
# - name: Run WebAuthn tests
# if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
# run: |
# mvn clean install -nsu -B -Dbrowser=chrome -Pwebauthn -f testsuite/integration-arquillian/tests/other/pom.xml -Dtest=org.keycloak.testsuite.webauthn.**.*Test | misc/log/trimmer.sh
#
# TEST_RESULT=${PIPESTATUS[0]}
# find . -path '*/target/surefire-reports/*.xml' | zip -q reports-webauthn-tests.zip -@
# exit $TEST_RESULT
#
# - name: WebAuthn test reports
# uses: actions/upload-artifact@v2
# if: failure()
# with:
# name: reports-webauthn-tests
# retention-days: 14
# path: reports-webauthn-tests.zip
2022-08-30 14:58:37 +00:00
# if-no-files-found: ignore