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]
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:
build:
name: Build
@ -15,9 +11,8 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15
with:
mirrors: ${{ env.MVN_MIRRORS }}
- name: Update maven settings
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name: Cache Maven packages
id: cache
uses: actions/cache@v2
@ -59,9 +54,8 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15
with:
mirrors: ${{ env.MVN_MIRRORS }}
- name: Update maven settings
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name: Cache Maven packages
uses: actions/cache@v2
with:
@ -101,9 +95,8 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15
with:
mirrors: ${{ env.MVN_MIRRORS }}
- name: Update maven settings
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name: Cache Maven packages
uses: actions/cache@v2
with:
@ -168,9 +161,8 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15
with:
mirrors: ${{ env.MVN_MIRRORS }}
- name: Update maven settings
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name: Run base tests
run: |
@ -233,10 +225,9 @@ jobs:
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
with:
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 }}
with:
mirrors: ${{ env.MVN_MIRRORS }}
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name: Run cluster tests
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 }}
with:
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 }}
with:
mirrors: ${{ env.MVN_MIRRORS }}
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name: Cache Maven packages
if: ${{ github.event_name != 'pull_request' || env.GIT_DIFF != 0 }}
@ -347,9 +337,8 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15
with:
mirrors: ${{ env.MVN_MIRRORS }}
- name: Update maven settings
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name: Run Quarkus cluster tests
run: |
echo '::group::Compiling testsuite'
@ -386,10 +375,8 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: whelk-io/maven-settings-xml-action@v15
with:
mirrors: ${{ env.MVN_MIRRORS }}
- name: Update maven settings
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
- name: Cache Maven packages
uses: actions/cache@v2
with:
@ -425,4 +412,4 @@ jobs:
retention-days: 2
path: |
test-logs
keycloak.log
keycloak.log

View file

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