KEYCLOAK-16189 Publish surefire reports

This commit is contained in:
Hynek Mlnarik 2020-11-05 15:35:47 +01:00 committed by Hynek Mlnařík
parent de20830412
commit f2856385bd
2 changed files with 249 additions and 131 deletions

View file

@ -1,104 +0,0 @@
name: Keycloak.X CI
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Maven packages
id: cache
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build cache
if: steps.cache.outputs.cache-hit != 'true'
run: |
mvn clean install -nsu -B -e -DskipTests -Pquarkus,distribution
test:
name: Test
needs: build
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2048m
steps:
- uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Run Quarkus unit tests
run: |
mvn clean install -nsu -B -Pquarkus -f quarkus/pom.xml
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -DskipTests -f testsuite/pom.xml
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -f testsuite/integration-arquillian/tests/base/pom.xml -Dtest='!org.keycloak.testsuite.adapter.**,!**.crossdc.**,!**.cluster.**' | misc/log/trimmer.sh
exit ${PIPESTATUS[0]}
test-adapter:
name: Test Adapter
needs: build
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx1024m
steps:
- uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Run adapter tests
run: |
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -DskipTests -f testsuite/pom.xml
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -f testsuite/integration-arquillian/tests/base/pom.xml -Dtest=org.keycloak.testsuite.adapter.** | misc/log/trimmer.sh
exit ${PIPESTATUS[0]}
test-cluster:
name: Test Clustering
needs: build
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2048m
steps:
- uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Run cluster tests
run: |
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -DskipTests -f testsuite/pom.xml
mvn clean install -nsu -B -Pauth-server-cluster-quarkus -Dsession.cache.owners=2 -Dtest=**.cluster.** -f testsuite/integration-arquillian/pom.xml | misc/log/trimmer.sh
exit ${PIPESTATUS[0]}

View file

@ -18,13 +18,25 @@ jobs:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build cache
if: steps.cache.outputs.cache-hit != 'true'
key: cache-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-${{ runner.os }}-m2
- name: Build Keycloak
run: |
mvn clean install -nsu -B -e -DskipTests -Pquarkus,distribution
- name: Store Keycloak artifacts
id: store-keycloak
uses: actions/upload-artifact@v2
with:
name: keycloak-artifacts.zip
retention-days: 2
path: |
~/.m2/repository/org/keycloak
!~/.m2/repository/org/keycloak/**/*.tar.gz
## Tests: Regular distribution
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
@ -38,10 +50,27 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
key: cache-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-${{ runner.os }}-m2
- name: Download built keycloak
id: download-keycloak
uses: actions/download-artifact@v2
with:
name: keycloak-artifacts.zip
- name: Run unit tests
run: mvn install -nsu -B -DskipTestsuite -DskipExamples -f pom.xml
run: |
mvn install -nsu -B -DskipTestsuite -DskipExamples -f pom.xml
TEST_RESULT=$?
find . -path '*/target/surefire-reports/*.xml' | zip reports-unit-tests.zip -@
exit $TEST_RESULT
- name: Unit test reports
uses: actions/upload-artifact@v2
if: failure()
with:
name: reports-unit-tests.zip
retention-days: 14
path: reports-unit-tests.zip
test:
name: Test
@ -56,8 +85,14 @@ jobs:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
key: cache-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-${{ runner.os }}-m2
- name: Download built keycloak
id: download-keycloak
uses: actions/download-artifact@v2
with:
name: keycloak-artifacts.zip
- uses: actions/setup-java@v1
with:
@ -65,9 +100,19 @@ jobs:
- name: Run base tests
run: |
mvn install -nsu -B -Pauth-server-wildfly -DskipTests -f testsuite/pom.xml
mvn install -nsu -B -Pauth-server-wildfly -f testsuite/integration-arquillian/tests/base/pom.xml | misc/log/trimmer.sh
exit ${PIPESTATUS[0]}
mvn clean install -nsu -B -Pauth-server-wildfly -DskipTests -f testsuite/pom.xml
mvn clean install -nsu -B -Pauth-server-wildfly -f testsuite/integration-arquillian/tests/base/pom.xml | misc/log/trimmer.sh
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip reports-base-tests.zip -@
exit $TEST_RESULT
- name: Base test reports
uses: actions/upload-artifact@v2
if: failure()
with:
name: reports-base-tests.zip
retention-days: 14
path: reports-base-tests.zip
test-cluster:
name: Test Clustering
@ -76,26 +121,49 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Check whether this phase should run
run: echo "GIT_DIFF=$( git diff --name-only HEAD^ | egrep -ic 'crossdc|infinispan' )" >> $GITHUB_ENV
- name: Cache Maven packages
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
key: cache-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-${{ runner.os }}-m2
- name: Download built keycloak
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
id: download-keycloak
uses: actions/download-artifact@v2
with:
name: keycloak-artifacts.zip
- uses: actions/setup-java@v1
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
with:
java-version: 1.8
- name: Run cluster tests
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
run: |
mvn clean install -B -Pauth-server-wildfly,auth-server-cluster,db-mysql,jpa -Dsession.cache.owners=2 -Dbackends.console.output=true -Dauth.server.log.check=false -Dfrontend.console.output=true -Dtest=org.keycloak.testsuite.cluster.**.*Test -f testsuite/integration-arquillian/pom.xml | misc/log/trimmer.sh
exit ${PIPESTATUS[0]}
mvn clean install -nsu -B -Pauth-server-wildfly,auth-server-cluster,db-mysql,jpa -Dsession.cache.owners=2 -Dbackends.console.output=true -Dauth.server.log.check=false -Dfrontend.console.output=true -Dtest=org.keycloak.testsuite.cluster.**.*Test -f testsuite/integration-arquillian/pom.xml | misc/log/trimmer.sh
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip reports-cluster-tests.zip -@
exit $TEST_RESULT
- name: Cluster test reports
if: failure()
uses: actions/upload-artifact@v2
with:
name: reports-cluster-tests.zip
retention-days: 14
path: reports-cluster-tests.zip
test-crossdc:
name: CrossDC Tests
name: Cross-DC Tests
needs: build
runs-on: ubuntu-latest
env:
@ -120,16 +188,33 @@ jobs:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
key: cache-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-${{ runner.os }}-m2
- name: Download built keycloak
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
id: download-keycloak
uses: actions/download-artifact@v2
with:
name: keycloak-artifacts.zip
- name: Run tests
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
shell: bash
run: |
mvn install -B -nsu -Pauth-servers-crossdc-jboss,auth-server-wildfly,cache-server-infinispan,app-server-wildfly -DskipTests
mvn install -B -nsu -f testsuite/integration-arquillian/tests/base/pom.xml -Pcache-server-infinispan,auth-servers-crossdc-jboss,auth-server-wildfly "-Dtest=org.keycloak.testsuite.crossdc.**.*,org.keycloak.testsuite.adapter.**.crossdc.**.*" | misc/log/trimmer.sh
exit ${PIPESTATUS[0]}
mvn clean install -B -nsu -Pauth-servers-crossdc-jboss,auth-server-wildfly,cache-server-infinispan,app-server-wildfly -DskipTests
mvn clean install -B -nsu -f testsuite/integration-arquillian/tests/base/pom.xml -Pcache-server-infinispan,auth-servers-crossdc-jboss,auth-server-wildfly "-Dtest=org.keycloak.testsuite.crossdc.**.*,org.keycloak.testsuite.adapter.**.crossdc.**.*" | misc/log/trimmer.sh
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip reports-cross-dc-tests.zip -@
exit $TEST_RESULT
- name: Cross-DC test reports
if: failure()
uses: actions/upload-artifact@v2
with:
name: reports-cross-dc-tests.zip
retention-days: 14
path: reports-cross-dc-tests.zip
test-undertow-map:
name: Test undertow - map provider
@ -146,8 +231,14 @@ jobs:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
key: cache-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-${{ runner.os }}-m2
- name: Download built keycloak
id: download-keycloak
uses: actions/download-artifact@v2
with:
name: keycloak-artifacts.zip
- uses: actions/setup-java@v1
with:
@ -155,6 +246,137 @@ jobs:
- name: Run base tests - undertow
run: |
mvn install -nsu -B -DskipTests -f testsuite/pom.xml
mvn install -nsu -B -f testsuite/integration-arquillian/tests/base/pom.xml -Dkeycloak.client.provider=map -Dkeycloak.group.provider=map -Dkeycloak.role.provider=map | misc/log/trimmer.sh
exit ${PIPESTATUS[0]}
mvn clean install -nsu -B -DskipTests -f testsuite/pom.xml
mvn clean install -nsu -B -f testsuite/integration-arquillian/tests/base/pom.xml -Dkeycloak.client.provider=map -Dkeycloak.group.provider=map -Dkeycloak.role.provider=map | misc/log/trimmer.sh
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip reports-base-undertow-tests.zip -@
exit $TEST_RESULT
- name: Base test - undertow reports
uses: actions/upload-artifact@v2
if: failure()
with:
name: reports-base-undertow-tests.zip
retention-days: 14
path: reports-base-undertow-tests.zip
### Tests: Quarkus distribution
quarkus-test:
name: Quarkus Test
needs: build
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2048m
steps:
- uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: cache-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-${{ runner.os }}-m2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Run Quarkus unit tests
run: |
mvn install -nsu -B -Pquarkus -f quarkus/pom.xml
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -DskipTests -f testsuite/pom.xml
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -f testsuite/integration-arquillian/tests/base/pom.xml -Dtest='!org.keycloak.testsuite.adapter.**,!**.crossdc.**,!**.cluster.**' | misc/log/trimmer.sh
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip reports-base-unit-tests.zip -@
exit $TEST_RESULT
- name: Base / unit test reports
uses: actions/upload-artifact@v2
if: failure()
with:
name: reports-base-unit-tests.zip
retention-days: 14
path: reports-base-unit-tests.zip
quarkus-test-adapter:
name: Quarkus Test Adapter
needs: build
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx1024m
steps:
- uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: cache-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-${{ runner.os }}-m2
- name: Download built keycloak
id: download-keycloak
uses: actions/download-artifact@v2
with:
name: keycloak-artifacts.zip
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Run adapter tests
run: |
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -DskipTests -f testsuite/pom.xml
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -f testsuite/integration-arquillian/tests/base/pom.xml -Dtest=org.keycloak.testsuite.adapter.** | misc/log/trimmer.sh
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip reports-adapter-tests.zip -@
exit $TEST_RESULT
- name: Adapter test reports
uses: actions/upload-artifact@v2
if: failure()
with:
name: reports-adapter-tests.zip
retention-days: 14
path: reports-adapter-tests.zip
quarkus-test-cluster:
name: Quarkus Test Clustering
needs: build
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2048m
steps:
- uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/org/keycloak
key: cache-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-${{ runner.os }}-m2
- name: Download built keycloak
id: download-keycloak
uses: actions/download-artifact@v2
with:
name: keycloak-artifacts.zip
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Run cluster tests
run: |
mvn clean install -nsu -B -Pquarkus,auth-server-quarkus -DskipTests -f testsuite/pom.xml
mvn clean install -nsu -B -Pauth-server-cluster-quarkus -Dsession.cache.owners=2 -Dtest=**.cluster.** -f testsuite/integration-arquillian/pom.xml | misc/log/trimmer.sh
TEST_RESULT=${PIPESTATUS[0]}
find . -path '*/target/surefire-reports/*.xml' | zip reports-cluster-tests.zip -@
exit $TEST_RESULT
- name: Cluster test reports
uses: actions/upload-artifact@v2
if: failure()
with:
name: reports-cluster-tests.zip
retention-days: 14
path: reports-cluster-tests.zip