Conditionally build WildFly adapters for our testsuite

Fixes #20077

Revert once https://github.com/keycloak/keycloak/issues/19299 is solved
This commit is contained in:
Martin Bartoš 2023-05-02 12:29:42 +02:00 committed by Marek Posolda
parent 90bc5835ea
commit a68aadd9d0
3 changed files with 40 additions and 2 deletions

View file

@ -39,13 +39,37 @@ runs:
name: PhantomJS cache
uses: ./.github/actions/phantomjs-cache
# Remove once https://github.com/keycloak/keycloak/issues/19299 is solved
########################################################################################################
- id: check-adapter-changes
if: github.event_name == 'pull_request'
name: Check changes for WildFly adapters
shell: bash
# If there are no changes for WildFly adapters, we use adapters built in the latest nightly build
run: |
WF_ADAPTERS_REGEX="^adapters/oidc/wildfly|^adapters/saml/wildfly"
git fetch origin --tags --force
echo "GIT_WF_ADAPTERS_DIFF=$(git diff origin/main --name-only | egrep -ic -e "$WF_ADAPTERS_REGEX")" >> $GITHUB_ENV
echo "NIGHTLY_DIFF=$(git diff nightly --name-only | egrep -ic -e "$WF_ADAPTERS_REGEX")" >> $GITHUB_ENV
- id: set-maven-profile
if: ${{ github.event_name != 'pull_request' || env.GIT_WF_ADAPTERS_DIFF != 0 || env.NIGHTLY_DIFF != 0}}
name: Set profile for building distribution
shell: bash
run: |
echo "MVN_PROFILES=-Pdistribution" >> $GITHUB_ENV
echo "WildFly adapters will be built in our codebase"
########################################################################################################
- 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
./mvnw install dependency:resolve -nsu -B -e -DskipTests -DskipExamples $MVN_HTTP_CONFIG ${{ env.MVN_PROFILES}}
- id: compress-keycloak-maven-repository
name: Compress Keycloak Maven artifacts

View file

@ -249,7 +249,7 @@
<configuration>
<wildfly-channel-resolution-mode>REQUIRED</wildfly-channel-resolution-mode>
<generate-channel-manifest>true</generate-channel-manifest>
git <add-feature-packs-as-required-manifests>false</add-feature-packs-as-required-manifests>
<add-feature-packs-as-required-manifests>false</add-feature-packs-as-required-manifests>
<fork-embedded>false</fork-embedded>
</configuration>
</execution>

View file

@ -70,6 +70,20 @@
<exists>src</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>${app.server.oidc.adapter.artifactId}</artifactId>
<version>${oidc-adapter.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>${app.server.saml.adapter.artifactId}</artifactId>
<version>${saml-adapter.version}</version>
<type>zip</type>
</dependency>
</dependencies>
<build>
<plugins>