Skip to content

Commit

Permalink
Merge branch 'main' into ce-setup-facter
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar authored Jan 24, 2022
2 parents 8a7973f + 32252cd commit aee663a
Show file tree
Hide file tree
Showing 373 changed files with 780 additions and 31,389 deletions.
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
/jans-client-api/ @duttarnab @yuriyz
/jans-config-api/ @pujavs @yuriyz
/jans-cli/ @mbaser
/jans-ce-setup/ @mbaser @smansoft
/jans-ce-setup/ @mbaser @smansoft
/jans-ce-setup/static/scripts/admin_ui_plugin.py @mbaser @duttarnab
8 changes: 0 additions & 8 deletions .github/JANNSEN_CODEOWNERS/docs_CODEOWNERS

This file was deleted.

8 changes: 0 additions & 8 deletions .github/JANNSEN_CODEOWNERS/home_CODEOWNERS

This file was deleted.

72 changes: 55 additions & 17 deletions .github/workflows/central_code_quality_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,64 @@ on:
- 'jans-pycloudlib/jans/pycloudlib/version.py'
- '**.md'
workflow_dispatch:

jobs:
build:
sonar-scan:
name: sonar scan
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module: [jans-auth-server, jans-config-api, jans-core, jans-setup, jans-cli, jans-client-api, jans-fido2, jans-notify, jans-orm, jans-scim, jans-eleven]
env:
JVM_PROJECTS: |
JanssenProject/jans-auth-server
JanssenProject/jans-config-api
JanssenProject/jans-core
jans-auth-server
jans-orm
jans-config-api
jans-client-api
jans-scim
jans-core
jans-notify
jans-fido2
jans-eleven
NON_JVM_PROJECTS: |
JanssenProject/jans-setup
JanssenProject/jans-cli
JanssenProject/jans-cloud-native
jans-setup
jans-cli
steps:
- uses: actions/checkout@v2
- name: check out code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of sonarqube analysis

- name: find changed directories
run: |
if [ $GITHUB_BASE_REF ]; then
# Pull Request
git fetch origin $GITHUB_BASE_REF --depth=1
echo "CHANGED_DIR=$( git diff --name-only ${{ github.event.before }} ${{ github.event.pull_request.head.sha }} | cut -d/ -f1 | sort -u | sed -z 's/\n/,/g;s/^/[/;s/,$/]/;s/$/\n/')" >> ${GITHUB_ENV}
else
# Push
git fetch origin ${{ github.event.before }} --depth=1
echo "CHANGED_DIR=$( git diff --name-only ${{ github.event.before }} $GITHUB_SHA | cut -d/ -f1 | sort -u | sed -z 's/\n/,/g;s/^/[/;s/,$/]/;s/$/\n/')" >> ${GITHUB_ENV}
fi
- name: check env
run: |
echo ${{ env.CHANGED_DIR }}
echo ${{ matrix.module }}
- name: Set up JDK 11
# JanssenProject/jans-cli is too similar to JanssenProject/jans-client-api as the contains function is returning it belonging to the JVM_PROJECT
if: contains(env.JVM_PROJECTS, github.repository) && github.repository != 'JanssenProject/jans-cli'
if: contains(env.CHANGED_DIR, matrix.module) && contains(env.JVM_PROJECTS, matrix.module) && matrix.module != 'jans-cli'
uses: actions/setup-java@v2.5.0
with:
java-version: '11'
distribution: 'adopt'

- name: Cache SonarCloud packages for JVM based project
# JanssenProject/jans-cli is too similar to JanssenProject/jans-client-api as the contains function is returning it belonging to the JVM_PROJECT
if: contains(env.JVM_PROJECTS, github.repository) && github.repository != 'JanssenProject/jans-cli'
if: contains(env.CHANGED_DIR, matrix.module) && contains(env.JVM_PROJECTS, matrix.module) && matrix.module != 'jans-cli'
uses: actions/cache@v2.1.7
with:
path: ~/.sonar/cache
Expand All @@ -64,15 +94,22 @@ jobs:

- name: Build and analyze JVM based project
# JanssenProject/jans-cli is too similar to JanssenProject/jans-client-api as the contains function is returning it belonging to the JVM_PROJECT
if: contains(env.JVM_PROJECTS, github.repository) && github.repository != 'JanssenProject/jans-cli'
if: contains(env.CHANGED_DIR, matrix.module) && contains(env.JVM_PROJECTS, matrix.module) && matrix.module != 'jans-cli'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
case "$GITHUB_REPOSITORY" in
"JanssenProject/jans-auth-server")
cd ${{ matrix.module }}
case ${{ matrix.module }} in
"jans-auth-server")
;&
"jans-client-api")
;&
"jans-scim")
;&
"jans-eleven")
;&
"JanssenProject/jans-config-api")
"jans-config-api")
echo "Run Sonar analysis without test execution"
mvn -B -DskipTests=true install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
;;
Expand All @@ -84,19 +121,20 @@ jobs:
- name: Convert repo org name to lowercase for non JVM projects
if: contains(env.NON_JVM_PROJECTS, github.repository)
if: contains(env.CHANGED_DIR, matrix.module) && contains(env.NON_JVM_PROJECTS, matrix.module)
env:
REPO_OWNER: ${{ github.repository_owner }}
run: |
echo "REPO_ORG=${REPO_OWNER,,}" >>${GITHUB_ENV}
- name: SonarCloud Scan for non-JVM project
if: contains(env.NON_JVM_PROJECTS, github.repository)
if: contains(env.CHANGED_DIR, matrix.module) && contains(env.NON_JVM_PROJECTS, matrix.module)
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=${{ env.REPO_ORG }}
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}
-Dsonar.projectKey=${{ github.repository_owner }}_${{ matrix.module }}
projectBaseDir: ${{ matrix.module }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Loading

0 comments on commit aee663a

Please sign in to comment.