keycloak-scim/.github/workflows/ci.yml

160 lines
5.1 KiB
YAML

name: Keycloak 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
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Run unit tests
run: mvn install -nsu -B -DskipTestsuite -DskipExamples -f pom.xml
test:
name: Test
needs: build
runs-on: ubuntu-latest
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 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]}
test-cluster:
name: Test Clustering
needs: build
runs-on: ubuntu-latest
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 -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]}
test-crossdc:
name: CrossDC Tests
needs: build
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx1024m
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 'crossdc|infinispan' )" >> $GITHUB_ENV
- uses: actions/setup-java@v1
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
with:
java-version: 1.8
- 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
- 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]}
test-undertow-map:
name: Test undertow - map provider
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 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]}