diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9da6438fe..61142116dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,7 +143,7 @@ jobs: fetch-depth: 2 - name: Check whether HEAD^ contains HotRod storage relevant changes - run: echo "GIT_HOTROD_RELEVANT_DIFF=$( git diff --name-only HEAD^ | egrep -ic -e '^model/hot-rod|^model/map|^model/build-processor|^testsuite/model' )" >> $GITHUB_ENV + 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 - name: Cache Maven packages if: ${{ github.event_name != 'pull_request' || matrix.server != 'undertow-map-hot-rod' || env.GIT_HOTROD_RELEVANT_DIFF != 0 }} @@ -202,6 +202,93 @@ jobs: path: reports-${{ matrix.server }}-base-tests-${{ matrix.tests }}.zip if-no-files-found: ignore + test-posgres: + name: Base testsuite (postgres) + needs: build + runs-on: ubuntu-latest + 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" + 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 + + - 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 + test-cluster: name: Test Clustering needs: build