[random-extension] #1 : update project config #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: sonarcloud-analysis | |
on: | |
workflow_dispatch: | |
# schedule: | |
# - cron: '0 11 * * 1' | |
push: | |
branches: | |
- master | |
- develop | |
paths-ignore: | |
- '.github/workflows/maven.yml' | |
- '.run/**' | |
- '.m2/**' | |
- '.repo/**' | |
env: | |
# Github Additional Configuration | |
GITHUB_REPO_NAME: ${{ github.event.repository.name }} | |
GITHUB_ACTOR: ${{ github.actor }} | |
GITHUB_PROJECT_DIR: ${{ github.workspace }} | |
GITHUB_TARGET_DIR: ${{ github.workspace }}/target | |
GITHUB_BRANCH_NAME: ${{ github.ref_name }} | |
GITHUB_UPLOAD_DIR: ${{ github.workspace }}/target/staging | |
GITHUB_UPLOAD_NAME: ${{ github.event.repository.name }}.zip | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PCK_READ_TOKEN: ${{ secrets.PCK_READ_TOKEN }} | |
PCK_WRITE_TOKEN: ${{ secrets.PCK_WRITE_TOKEN }} | |
# Maven Common Configuration | |
MVN_HOME_DIR: ~/.m2 | |
MVN_REPO_JOB_DIR: ${{ github.workspace }}/.repo | |
MVN_SETTING_JOB_FILE: ${{ github.workspace }}/.m2/settings.xml | |
MVN_SETT_OPTS: -V -B | |
MVN_SETS_OPTS: -V -B -s${{ github.workspace }}/.m2/settings.xml | |
MVN_REPO_OPTS: -Dmaven.repo.local=${{ github.workspace }}/.repo | |
# Codacy Configuration | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }} | |
MVN_CODACY_OPTS: -DcoverageReportFile=target/jacoco/comm/jacoco.xml -DprojectToken=${{ secrets.CODACY_PROJECT_TOKEN }} -DapiToken=${{ secrets.CODACY_API_TOKEN }} | |
# Coveralls Configuration | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
MVN_COVERALLS_OPTS: -Dbranch=${{ github.ref_name }} -DrepoToken=${{ secrets.COVERALLS_REPO_TOKEN }} | |
jobs: | |
sonarcloud: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
version: [17] | |
distribution: [adopt] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: setup JDK | |
uses: actions/[email protected] | |
with: | |
java-version: '${{ matrix.version }}' | |
distribution: '${{ matrix.distribution }}' | |
architecture: x64 | |
- name: cache maven packages | |
uses: actions/[email protected] | |
with: | |
path: ${{ env.MVN_REPO_JOB_DIR }} | |
key: ${{ matrix.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ matrix.os }}-m2 | |
- name: cache sonarcloud packages | |
uses: actions/[email protected] | |
with: | |
path: ${{ env.SONAR_CACHE_DIR }} | |
key: ${{ matrix.os }}-sonar | |
restore-keys: ${{ matrix.os }}-sonar-${{ hashFiles('**/pom.xml') }} | |
- name: show_repo | |
run: | | |
mkdir -p ${{ env.MVN_REPO_JOB_DIR }} | |
du --max-depth=2 -h ${{ env.MVN_REPO_JOB_DIR }} | |
# - name: codacy coverage upload | |
# run: mvn ${{ env.MVN_SETS_OPTS }} ${{ env.MVN_SIGN_OPTS }} ${{ env.MVN_TEST_OPTS_Y }} ${{ env.MVN_CODACY_OPTS }} help:active-profiles verify com.gavinmogan:codacy-maven-plugin:coverage | |
# - name: coveralls scan | |
# run: mvn ${{ env.MVN_SETS_OPTS }} ${{ env.MVN_SIGN_OPTS }} ${{ env.MVN_TEST_OPTS_Y }} ${{ env.MVN_COVERALLS_OPTS }} help:active-profiles verify coveralls:report | |
- name: sonarcloud scan | |
run: mvn ${{ env.MVN_SETS_OPTS }} ${{ env.MVN_REPO_OPTS }} ${{ env.MVN_SIGN_OPTS }} ${{ env.MVN_TEST_OPTS_Y }} ${{ env.MVN_SONAR_OPTS }} help:active-profiles verify sonar:sonar |