Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAT-10564 #72

Merged
merged 60 commits into from
Sep 19, 2023
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
6f9a484
fix(sonar-test-scan.yml): add installation of sqlcmd to setup docker …
Sep 6, 2023
798f55c
chore(sonar-test-scan.yml): update runs-on field from macos-latest-xl…
Sep 6, 2023
768a2c0
chore(sonar-test-scan.yml): add support for downloading and merging i…
Sep 11, 2023
01c931c
chore(sonar-test-scan.yml): add optional coverageModuleName input to …
Sep 11, 2023
ba86102
fix(sonar-test-scan.yml): fix typo in mvn command to merge integratio…
Sep 11, 2023
f35048f
chore(sonar-test-scan.yml): update Maven settings.xml action to versi…
Sep 11, 2023
c5ba5d1
fix(sonar-test-scan.yml): remove duplicate 'mvn' command in the 'Merg…
Sep 11, 2023
2575d32
fix(sonar-test-scan.yml): update download-artifact action to use dawi…
Sep 11, 2023
7870ee8
chore(sonar-test-scan.yml): update maven-settings-xml-action to v20 f…
Sep 11, 2023
249dea7
chore(sonar-test-scan.yml): add step to save test results as artifact…
Sep 11, 2023
039a1eb
chore(sonar-test-scan.yml): update Maven settings.xml action to versi…
Sep 11, 2023
d4f8e35
chore(sonar-test-scan.yml): remove unnecessary if condition for savin…
Sep 11, 2023
7cb1141
chore(sonar-test-scan.yml): remove matrix variable from liquibase-int…
Sep 11, 2023
ab23cfe
chore(sonar-test-scan.yml): add optional inputs for unit test report …
Sep 11, 2023
c758c58
fix(sonar-test-scan.yml): fix duplicate '-DskipTests' flag in the Mav…
Sep 11, 2023
17fe422
fix(sonar-test-scan.yml): remove duplicate '-DskipTests' flag in the …
Sep 11, 2023
80266da
chore(sonar-test-scan.yml): update java-version from 11 to 17 to use …
Sep 11, 2023
55590c6
chore(sonar-test-scan.yml): add specific paths for downloaded artifac…
Sep 11, 2023
437581b
chore(sonar-test-scan.yml): improve merging and moving of test reports
Sep 11, 2023
2ce518d
chore(sonar-test-scan.yml): add ls command to list files in reports d…
Sep 11, 2023
4782573
chore(sonar-test-scan.yml): update download-artifact action to versio…
Sep 11, 2023
85283fc
chore(sonar-test-scan.yml): add a sleep step to wait for test reports…
Sep 11, 2023
228e8a0
chore(sonar-test-scan.yml): update file paths for jacoco coverage rep…
Sep 13, 2023
62a39e9
fix(sonar-test-scan.yml): fix file path for moving coverage reports t…
Sep 13, 2023
b84856a
chore(sonar-test-scan.yml): remove unnecessary ls command in the work…
Sep 13, 2023
0dc20e4
fix(sonar-test-scan.yml): remove unnecessary directory creation step …
Sep 13, 2023
d753cdc
chore(sonar-test-scan.yml): update file paths for aggregated coverage…
Sep 13, 2023
9a209e4
fix(sonar-test-scan.yml): update file paths for jacoco coverage repor…
Sep 13, 2023
faffa85
chore(sonar-test-scan.yml): reorganize build steps for better readabi…
Sep 13, 2023
7f28f82
refactor(sonar-test-scan.yml): simplify file paths for moving jacoco …
Sep 13, 2023
805ef94
fix(sonar-test-scan.yml): update jacoco download link to use the offi…
Sep 13, 2023
2f5a8f0
fix(sonar-test-scan.yml): fix typo in the file path for jacococli.jar
Sep 13, 2023
0bbffef
fix(sonar-test-scan.yml): fix the path to jacococli.jar in the java c…
Sep 13, 2023
4545266
chore(sonar-test-scan.yml): add missing cd command to navigate to the…
Sep 13, 2023
9ee41c9
fix(sonar-test-scan.yml): remove redundant file path in java -jar com…
Sep 13, 2023
4509a53
fix(sonar-test-scan.yml): fix the path to classfiles in the jacoco re…
Sep 13, 2023
6f25355
chore(sonar-test-scan.yml): downgrade Java version from 17 to 8 and c…
Sep 13, 2023
dbd8d5f
fix(sonar-test-scan.yml): fix classfiles path in Jacoco report comman…
Sep 13, 2023
93d4791
chore(sonar-test-scan.yml): add optional inputs for testedClassesModu…
Sep 13, 2023
74d496b
chore(sonar-test-scan.yml): update Java version and distribution to u…
Sep 13, 2023
4092185
fix(sonar-test-scan.yml): remove redundant line that duplicates the m…
Sep 13, 2023
1a63e5f
chore(sonar-test-scan.yml): update action-download-artifact version t…
Sep 13, 2023
22c0b79
chore(sonar-test-scan.yml): install mvnd and use it instead of mvn fo…
Sep 13, 2023
0b622b7
chore(sonar-test-scan.yml): add workflow and run_id parameters to dow…
Sep 14, 2023
0317516
chore(sonar-test-scan.yml): update download-artifact action to versio…
Sep 14, 2023
420f03b
chore(sonar-test-scan.yml): remove unnecessary sleep command in the w…
Sep 14, 2023
d569eef
chore(sonar-test-scan.yml): remove installation of mvnd and update Ma…
Sep 14, 2023
262b309
chore(sonar-test-scan.yml): remove unused integrationTestsModuleName …
Sep 14, 2023
617c5b7
fix(sonar-test-scan.yml): add 'package' phase to the Maven command to…
Sep 14, 2023
66fe14b
fix(sonar-test-scan.yml): update file path for moving jacoco.exec fil…
Sep 14, 2023
a2abd15
fix(sonar-test-scan.yml): update file path for moving jacoco.exec fil…
Sep 14, 2023
4691252
chore(sonar-test-scan.yml): remove unnecessary artifact saving step f…
Sep 14, 2023
de197c9
fix(sonar-test-scan.yml): change sonar.login to sonar.token to align …
Sep 14, 2023
4b90fce
chore(sonar-test-scan.yml): add default value for sonar.coverage.excl…
Sep 14, 2023
73bfd73
Merge branch 'main' into DAT-10564
Sep 18, 2023
c58276e
chore(sonar-test-scan.yml): remove unused coverageModuleName input va…
Sep 18, 2023
888fc82
chore(sonar-test-scan.yml): download and move jacoco.exec files for h…
Sep 18, 2023
a8e9e68
chore(sonar-test-scan.yml): add support for downloading and processin…
Sep 18, 2023
277b576
chore(sonar-test-scan.yml): add step to download firebird integration…
Sep 18, 2023
7531bf0
chore(create-release.yml): update sonar-push.yml version to v0.4.3 fo…
Sep 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore(sonar-test-scan.yml): add optional inputs for unit test report …
…artifact name, integration test report artifact name, and coverage module name to improve flexibility and customization

fix(sonar-test-scan.yml): remove unnecessary step to install mvnd
feat(sonar-test-scan.yml): download unit test report artifact and integration test report artifacts for mssql, mysql, oracle, and postgresql databases
feat(sonar-test-scan.yml): merge integration and unit tests reports using jacoco
feat(sonar-test-scan.yml): add step to cache SonarCloud packages for faster subsequent runs
feat(sonar-test-scan.yml): add step to perform Sonar Scan with necessary environment variables and configurations
chore(sonar-test-scan.yml): remove unnecessary step to save test results as artifacts
  • Loading branch information
jandroav committed Sep 11, 2023
commit ab23cfebb5b3b799c2c301a6edd94dc7b77989ed
78 changes: 46 additions & 32 deletions .github/workflows/sonar-test-scan.yml
Original file line number Diff line number Diff line change
@@ -31,6 +31,18 @@ on:
description: 'The maven arguments to be passed to the mvn command'
type: string
required: false
unitTestReportArtifactName:
description: 'The name of the unit test report artifact'
type: string
required: false
integrationTestReportArtifactName:
description: 'The name of the integration test report artifact'
type: string
required: false
coverageModuleName:
description: 'The name of the coverage module'
type: string
required: false

env:
MAVEN_VERSION: '3.8.7'
@@ -58,13 +70,6 @@ jobs:
with:
maven-version: ${{ env.MAVEN_VERSION }}

- name: Install mvnd
run: |
wget https://github.com/apache/maven-mvnd/releases/download/1.0-m7/maven-mvnd-1.0-m7-m39-linux-amd64.zip
unzip maven-mvnd-1.0-m7-m39-linux-amd64.zip && mv maven-mvnd-1.0-m7-m39-linux-amd64 mvnd && chmod +x mvnd/bin/mvnd
ls -ltr
ls -ltr ./mvnd

- name: Set up Maven settings.xml
uses: whelk-io/maven-settings-xml-action@v21
with:
@@ -107,21 +112,35 @@ jobs:
}
]

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
- name: Download unit tests report
uses: dawidd6/action-download-artifact@v2.27.0
with:
registry: ghcr.io
username: liquibot
password: ${{ secrets.GHCR_PAT }}
name: ${{ inputs.unitTestReportArtifactName }}
if_no_artifact_found: warn

- name: Install sqlplus for Integration tests
run: |
wget -nv --directory-prefix=$HOME -nc https://download.oracle.com/otn_software/linux/instantclient/215000/instantclient-sqlplus-linux.x64-21.5.0.0.0dbru.zip
unzip $HOME/instantclient-sqlplus-linux.x64-21.5.0.0.0dbru.zip -d $HOME
sleep 3
wget -nv --directory-prefix=$HOME -nc https://download.oracle.com/otn_software/linux/instantclient/215000/instantclient-basiclite-linux.x64-21.5.0.0.0dbru.zip
unzip $HOME/instantclient-basiclite-linux.x64-21.5.0.0.0dbru.zip -d $HOME
chmod -R a+x $HOME/instantclient_21_5/
- name: Download mssql integration tests report
uses: dawidd6/action-download-artifact@v2.27.0
with:
name: ${{ inputs.integrationTestReportArtifactName }}-mssql
if_no_artifact_found: warn

- name: Download mysql integration tests report
uses: dawidd6/action-download-artifact@v2.27.0
with:
name: ${{ inputs.integrationTestReportArtifactName }}-mysql
if_no_artifact_found: warn

- name: Download oracle integration tests report
uses: dawidd6/action-download-artifact@v2.27.0
with:
name: ${{ inputs.integrationTestReportArtifactName }}-oracle
if_no_artifact_found: warn

- name: Download postgresql integration tests report
uses: dawidd6/action-download-artifact@v2.27.0
with:
name: ${{ inputs.integrationTestReportArtifactName }}-postgresql
if_no_artifact_found: warn

- name: Cache SonarCloud packages
uses: actions/cache@v3
@@ -130,14 +149,19 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Merge integration and unit tests reports
run: |
cd ${{ inputs.coverageModuleName }}
mvn jacoco:report-aggregate@report-aggregate
mvn jacoco:merge@merge-results

- name: Sonar Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.PRO_LICENSE_KEY }}
run: |
export ORACLE_HOME=$ORACLE_HOME:$HOME/instantclient_21_5; export PATH=$PATH:$HOME/instantclient_21_5; export SQLPATH=$HOME/instantclient_21_5; export NLS_LANG=AMERICAN_AMERICA.UTF8; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/instantclient_21_5
./mvnd/bin/mvnd -B clean verify sonar:sonar -P 'testAll,!run-proguard' -Dliquibase.version=${{ inputs.liquibaseBranchName }}-SNAPSHOT \
mvn -B sonar:sonar -P '!run-proguard' -DskipTests -Dliquibase.version=${{ inputs.liquibaseBranchName }}-SNAPSHOT \
${{ inputs.mavenArgs }} \
-Dsonar.scm.revision=${{ inputs.thisSha }} \
-Dsonar.login=$SONAR_TOKEN \
@@ -155,13 +179,3 @@ jobs:
-Dsonar.scm.provider=git \
-Daws.region="us-east-1" \
-T 1C

- name: Save Test Results
uses: actions/upload-artifact@v3
with:
name: liquibase-integration-test-results
path: |
./**/target/surefire-reports
./**/target/site
./**/target/jacoco.exec
./**/target/aggregate.exec