KEYCLOAK-18147 Fix CodeQL failures

This commit is contained in:
Hynek Mlnarik 2021-05-18 18:04:36 +02:00 committed by Hynek Mlnařík
parent 164f3df080
commit 11b72d20e7
3 changed files with 34 additions and 30 deletions

14
.github/settings.xml vendored Normal file
View file

@ -0,0 +1,14 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>jboss-public-repository-group-https</id>
<mirrorOf>jboss-public-repository-group</mirrorOf>
<name>Jboss public https</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</mirror>
</mirrors>
</settings>

View file

@ -2,10 +2,6 @@ name: Keycloak CI
on: [push, pull_request] on: [push, pull_request]
env:
# workaround for Maven >= 3.8.1 (see KEYCLOAK-17812)
MVN_MIRRORS: '[{ "id": "jboss-public-repository-group-https", "mirrorOf": "jboss-public-repository-group", "url": "https://repository.jboss.org/nexus/content/groups/public/" }]'
jobs: jobs:
build: build:
name: Build name: Build
@ -15,9 +11,8 @@ jobs:
- uses: actions/setup-java@v1 - uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15 - name: Update maven settings
with: run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
mirrors: ${{ env.MVN_MIRRORS }}
- name: Cache Maven packages - name: Cache Maven packages
id: cache id: cache
uses: actions/cache@v2 uses: actions/cache@v2
@ -59,9 +54,8 @@ jobs:
- uses: actions/setup-java@v1 - uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15 - name: Update maven settings
with: run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
mirrors: ${{ env.MVN_MIRRORS }}
- name: Cache Maven packages - name: Cache Maven packages
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
@ -101,9 +95,8 @@ jobs:
- uses: actions/setup-java@v1 - uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15 - name: Update maven settings
with: run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
mirrors: ${{ env.MVN_MIRRORS }}
- name: Cache Maven packages - name: Cache Maven packages
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
@ -168,9 +161,8 @@ jobs:
- uses: actions/setup-java@v1 - uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15 - name: Update maven settings
with: run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
mirrors: ${{ env.MVN_MIRRORS }}
- name: Run base tests - name: Run base tests
run: | run: |
@ -233,10 +225,9 @@ jobs:
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }} if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
with: with:
java-version: 1.8 java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15 - name: Update maven settings
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }} if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
with: run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
mirrors: ${{ env.MVN_MIRRORS }}
- name: Run cluster tests - name: Run cluster tests
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }} if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
@ -273,10 +264,9 @@ jobs:
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }} if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
with: with:
java-version: 1.8 java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15 - name: Update maven settings
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }} if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
with: run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
mirrors: ${{ env.MVN_MIRRORS }}
- name: Cache Maven packages - name: Cache Maven packages
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }} if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
@ -347,9 +337,8 @@ jobs:
- uses: actions/setup-java@v1 - uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15 - name: Update maven settings
with: run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
mirrors: ${{ env.MVN_MIRRORS }}
- name: Run Quarkus cluster tests - name: Run Quarkus cluster tests
run: | run: |
echo '::group::Compiling testsuite' echo '::group::Compiling testsuite'
@ -386,10 +375,8 @@ jobs:
- uses: actions/setup-java@v1 - uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15 - name: Update maven settings
with: run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
mirrors: ${{ env.MVN_MIRRORS }}
- name: Cache Maven packages - name: Cache Maven packages
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
@ -425,4 +412,4 @@ jobs:
retention-days: 2 retention-days: 2
path: | path: |
test-logs test-logs
keycloak.log keycloak.log

View file

@ -32,6 +32,9 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Update maven settings
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v1