Skip to content

Commit

Permalink
DAT-10564 (#72)
Browse files Browse the repository at this point in the history
* fix(sonar-test-scan.yml): add installation of sqlcmd to setup docker step for MacOS compatibility
refactor(sonar-test-scan.yml): remove installation of sqlplus for integration tests as it is no longer needed
refactor(sonar-test-scan.yml): remove unnecessary environment variable exports and sourcing of bash profile in SonarCloud step

* chore(sonar-test-scan.yml): update runs-on field from macos-latest-xl to ubuntu-22.04 for better compatibility
feat(sonar-test-scan.yml): update mvnd installation process to download and unzip the latest release from the official Apache Maven mvnd repository
feat(sonar-test-scan.yml): add installation steps for sqlplus and instantclient for integration tests
chore(sonar-test-scan.yml): remove unnecessary setup steps for docker and sqlcmd

* chore(sonar-test-scan.yml): add support for downloading and merging integration test reports

feat(sonar-test-scan.yml): add support for downloading unit test report artifact

feat(sonar-test-scan.yml): add support for downloading integration test report artifacts for different databases (mssql, mysql, oracle, postgresql)

chore(sonar-test-scan.yml): remove unnecessary step to install mvnd

chore(sonar-test-scan.yml): remove unnecessary step to install sqlplus for integration tests

chore(sonar-test-scan.yml): cache SonarCloud packages to improve build performance

chore(sonar-test-scan.yml): merge integration and unit tests reports before running Sonar Scan

* chore(sonar-test-scan.yml): add optional coverageModuleName input to specify the name of the coverage module
fix(sonar-test-scan.yml): fix the directory change command to use the coverageModuleName input value instead of a hardcoded value

* fix(sonar-test-scan.yml): fix typo in mvn command to merge integration and unit tests reports
feat(sonar-test-scan.yml): add separate mvn command to merge jacoco results for better clarity and maintainability

* chore(sonar-test-scan.yml): update Maven settings.xml action to version v21 for compatibility and potential bug fixes

* fix(sonar-test-scan.yml): remove duplicate 'mvn' command in the 'Merge integration and unit tests reports' step

* fix(sonar-test-scan.yml): update download-artifact action to use dawidd6/action-download-artifact@v2.27.0 to fix compatibility issue
feat(sonar-test-scan.yml): add if_no_artifact_found: warn option to download-artifact actions to prevent failure when no artifact is found
refactor(sonar-test-scan.yml): update download artifact names to use dynamic inputs for integration test reports to improve flexibility and reusability
refactor(sonar-test-scan.yml): update download artifact names to use dynamic inputs for integration test reports to improve flexibility and reusability

* chore(sonar-test-scan.yml): update maven-settings-xml-action to v20 for Maven settings.xml setup
chore(sonar-test-scan.yml): update docker/login-action to v2 for GitHub Container Registry login
chore(sonar-test-scan.yml): update action-download-artifact to v2.27.0 for downloading integration test reports
chore(sonar-test-scan.yml): add installation steps for sqlplus and instantclient for Integration tests
chore(sonar-test-scan.yml): remove merge integration and unit tests reports step
chore(sonar-test-scan.yml): update mvn command to include ORACLE_HOME, PATH, SQLPATH, NLS_LANG, and LD_LIBRARY_PATH environment variables for Oracle integration tests

* chore(sonar-test-scan.yml): add step to save test results as artifacts if archive_test_results input is true

* chore(sonar-test-scan.yml): update Maven settings.xml action to version v21 for compatibility and potential bug fixes

* chore(sonar-test-scan.yml): remove unnecessary if condition for saving test results artifact

* chore(sonar-test-scan.yml): remove matrix variable from liquibase-integration-test-results artifact name to simplify naming convention

* 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

* fix(sonar-test-scan.yml): fix duplicate '-DskipTests' flag in the Maven command

The duplicate '-DskipTests' flag in the Maven command was causing an error. Removed the duplicate flag to fix the issue.

* fix(sonar-test-scan.yml): remove duplicate '-DskipTests' flag in the Maven command to avoid redundancy and improve readability

* chore(sonar-test-scan.yml): update java-version from 11 to 17 to use the latest version of Java for the Sonar test scan workflow

* chore(sonar-test-scan.yml): add specific paths for downloaded artifacts to improve organization and readability

* chore(sonar-test-scan.yml): improve merging and moving of test reports

The changes in this commit improve the merging and moving of test reports in the sonar-test-scan.yml workflow file.

- Added commands to list the contents of directories for debugging purposes.
- Created a new directory called "reports" to store the merged test reports.
- Moved the unit test coverage report to the "reports" directory.
- Moved the integration test coverage reports for different databases (mssql, mysql, oracle, postgresql) to the "reports" directory.
- Moved the aggregated coverage reports for different databases to the "reports" directory.
- Updated the commands to use the correct paths for moving the files.
- Added comments to explain the purpose of each command.

* chore(sonar-test-scan.yml): add ls command to list files in reports directory for debugging purposes

* chore(sonar-test-scan.yml): update download-artifact action to version 3 for unit and integration test reports
chore(sonar-test-scan.yml): remove if_no_artifact_found option from download-artifact action for integration test reports
chore(sonar-test-scan.yml): update download-artifact action for integration test reports to use correct artifact names and paths
chore(sonar-test-scan.yml): remove if_no_artifact_found option from download-artifact action for postgresql integration test report
chore(sonar-test-scan.yml): remove unnecessary whitespace

* chore(sonar-test-scan.yml): add a sleep step to wait for test reports before continuing the workflow execution
chore(sonar-test-scan.yml): update comment to disable shallow clones for better analysis relevancy
chore(sonar-test-scan.yml): add step to set up JDK for the workflow execution

* chore(sonar-test-scan.yml): update file paths for jacoco coverage reports

The file paths for the jacoco coverage reports have been updated in the sonar-test-scan.yml workflow file. The following changes were made:

- The unit test coverage report file path has been changed from "unit-tests/liquibase-pro-coverage/target/aggregate.exec" to "unit-tests/liquibase-pro-coverage/target/jacoco.exec" and it has been moved to the "./reports/jacoco-unit.exec" directory.
- The integration test coverage report file paths for mssql and mysql have been updated from "integration-tests/mssql/liquibase-pro-integration-tests/target/jacoco.exec" and "integration-tests/mysql/liquibase-pro-integration-tests/target/jacoco.exec" respectively.

* fix(sonar-test-scan.yml): fix file path for moving coverage reports to the correct directory
feat(sonar-test-scan.yml): add step to save Jacoco mixed results as an artifact for further analysis

* chore(sonar-test-scan.yml): remove unnecessary ls command in the workflow file

* fix(sonar-test-scan.yml): remove unnecessary directory creation step to simplify the workflow

The directory creation step was creating an unnecessary directory in the workflow. This step has been removed to simplify the workflow and improve readability.

* chore(sonar-test-scan.yml): update file paths for aggregated coverage reports to match new directory structure

The file paths for the aggregated coverage reports in the integration tests have been updated to match the new directory structure. The "aggregate.exec" files are now moved to the "target" directory instead of the "reports" directory. This change ensures that the coverage reports are generated in the correct location for each database type (mssql, mysql, oracle, postgresql).

* fix(sonar-test-scan.yml): update file paths for jacoco coverage reports to match the new directory structure
feat(sonar-test-scan.yml): add steps to download jacoco cli, move it to the appropriate directory, and generate coverage report using jacoco cli

* chore(sonar-test-scan.yml): reorganize build steps for better readability and maintainability
fix(sonar-test-scan.yml): move 'mvn package' command before 'mvn jacoco:merge@cli-merge-results' to ensure correct coverage results
feat(sonar-test-scan.yml): add liquibase version parameter to 'mvn package' command for better control over liquibase version used

* refactor(sonar-test-scan.yml): simplify file paths for moving jacoco coverage files

The file paths for moving jacoco coverage files were simplified to improve readability and maintainability.

* fix(sonar-test-scan.yml): update jacoco download link to use the official GitHub release URL
fix(sonar-test-scan.yml): fix the path to move jacococli.jar to the correct location

* fix(sonar-test-scan.yml): fix typo in the file path for jacococli.jar
fix(sonar-test-scan.yml): move the 'cd' command before merging jacoco results to the correct directory

* fix(sonar-test-scan.yml): fix the path to jacococli.jar in the java command to generate Jacoco report

* chore(sonar-test-scan.yml): add missing cd command to navigate to the target directory before running jacococli.jar command

* fix(sonar-test-scan.yml): remove redundant file path in java -jar command to fix jacoco report generation

The file path "./target" was duplicated in the java -jar command, causing the jacoco report generation to fail. This commit removes the redundant file path to fix the issue.

* fix(sonar-test-scan.yml): fix the path to classfiles in the jacoco report command

The path to the classfiles in the jacoco report command was incorrect. It was pointing to "../../pro/target/" instead of "../../pro/target/classes/". This fix corrects the path to ensure that the jacoco report command can find the necessary classfiles for generating the coverage report.

* chore(sonar-test-scan.yml): downgrade Java version from 17 to 8 and change distribution from 'temurin' to 'adopt' for compatibility reasons

* fix(sonar-test-scan.yml): fix classfiles path in Jacoco report command to point to the correct directory

* chore(sonar-test-scan.yml): add optional inputs for testedClassesModuleName and integrationTestsModuleName to improve flexibility
fix(sonar-test-scan.yml): update file paths to use the new inputs for testedClassesModuleName and integrationTestsModuleName
fix(sonar-test-scan.yml): update artifact name for jacoco mixed report to improve clarity

* chore(sonar-test-scan.yml): update Java version and distribution to use Java 17 with Temurin
chore(sonar-test-scan.yml): refactor file moving logic to handle different integration test directories
chore(sonar-test-scan.yml): remove unnecessary -T flag from Maven command

* fix(sonar-test-scan.yml): remove redundant line that duplicates the mvn command

The redundant line `mvn -B verify -P 'unit,!run-proguard' -Dliquibase.version=${{ inputs.liquibaseBranchName }}-SNAPSHOT` is removed to avoid duplication and improve code readability.

* chore(sonar-test-scan.yml): update action-download-artifact version to v2.27.0 for all artifact downloads
chore(sonar-test-scan.yml): add 'if_no_artifact_found: warn' option to all artifact downloads to handle missing artifacts gracefully
chore(sonar-test-scan.yml): remove unnecessary whitespace

* chore(sonar-test-scan.yml): install mvnd and use it instead of mvn for build and analysis steps

* chore(sonar-test-scan.yml): add workflow and run_id parameters to download test reports

The workflow file 'sonar-test-scan.yml' was modified to include the 'workflow' and 'run_id' parameters in the steps that download test reports. This change allows the download step to be associated with the correct workflow run and ensures that the test reports are downloaded from the correct workflow run.

* chore(sonar-test-scan.yml): update download-artifact action to version 3 for unit and integration tests reports
chore(sonar-test-scan.yml): remove unnecessary if_no_artifact_found option from download-artifact actions
chore(sonar-test-scan.yml): remove unnecessary workflow and run_id options from download-artifact actions
chore(sonar-test-scan.yml): add if: always() condition to download-artifact actions for integration tests reports
chore(sonar-test-scan.yml): add if: always() condition to cache SonarCloud packages action
chore(sonar-test-scan.yml): add if: always() condition to merge integration and unit tests reports step
chore(sonar-test-scan.yml): add if: always() condition to save Jacoco Mixed Results step
chore(sonar-test-scan.yml): add if: always() condition to Sonar Scan step

* chore(sonar-test-scan.yml): remove unnecessary sleep command in the workflow
chore(sonar-test-scan.yml): remove unused step to wait for test reports in the workflow

* chore(sonar-test-scan.yml): remove installation of mvnd and update Maven commands to use 'mvn' command instead of './mvnd/bin/mvnd'

The installation of mvnd has been removed as it is no longer needed. The Maven commands have been updated to use the 'mvn' command instead of './mvnd/bin/mvnd' for consistency and to align with standard Maven usage.

* chore(sonar-test-scan.yml): remove unused integrationTestsModuleName input variable
refactor(sonar-test-scan.yml): simplify file path for moving jacoco.exec files in integration tests

* fix(sonar-test-scan.yml): add 'package' phase to the Maven command to ensure the project is built before running SonarQube analysis

* fix(sonar-test-scan.yml): update file path for moving jacoco.exec file to improve accuracy and consistency

* fix(sonar-test-scan.yml): update file path for moving jacoco.exec file to improve accuracy and consistency

* chore(sonar-test-scan.yml): remove unnecessary artifact saving step for Jacoco mixed results
chore(sonar-test-scan.yml): rename sonar-push job to sonar-scan for better clarity and consistency

* fix(sonar-test-scan.yml): change sonar.login to sonar.token to align with SonarQube API changes and improve security

The SonarQube API has changed and now requires the use of the `sonar.token` parameter instead of `sonar.login` for authentication. This change ensures that the correct parameter is used and improves the security of the SonarQube integration.

* chore(sonar-test-scan.yml): add default value for sonar.coverage.exclusions to exclude test files and pom.xml from coverage analysis

* chore(sonar-test-scan.yml): remove unused coverageModuleName input variable
chore(sonar-test-scan.yml): update paths for merging and moving coverage reports to match new project structure
chore(sonar-test-scan.yml): update paths for jacococli.jar and classfiles in jacoco:merge step to match new project structure

* chore(sonar-test-scan.yml): download and move jacoco.exec files for h2, hsqldb, and mariadb integration tests to the appropriate directories

The changes were made to the sonar-test-scan.yml workflow file. The following changes were made:

- Added a step to download the h2 integration tests report artifact and move the jacoco.exec file to the integration-tests/h2 directory.
- Added a step to download the hsqldb integration tests report artifact and move the jacoco.exec file to the integration-tests/hsqldb directory.
- Added a step to download the mariadb integration tests report artifact and move the jacoco.exec file to the integration-tests/mariadb directory.

These changes were made to ensure that the jacoco.exec files for the h2, hsqldb, and mariadb integration tests are available in the correct directories for further processing.

* chore(sonar-test-scan.yml): add support for downloading and processing sqlite integration test reports
chore(sonar-test-scan.yml): move jacoco.exec file from sqlite integration test report to liquibase-coverage target directory

* chore(sonar-test-scan.yml): add step to download firebird integration tests report artifact
chore(sonar-test-scan.yml): move firebird jacoco.exec file to target directory for coverage analysis

* chore(create-release.yml): update sonar-push.yml version to v0.4.3 for improved functionality
chore(extension-attach-artifact-release.yml): update script file versions to v0.4.3 for improved functionality
chore(extension-release-published.yml): update extension-release-prepare.yml version to v0.4.3 for improved functionality
chore(os-extension-test.yml): update sonar-pull-request.yml version to v0.4.3 for improved functionality
chore(package-deb.yml): update file versions to v0.4.3 for improved functionality
chore(pom-release-published.yml): update extension-release-prepare.yml version to v0.4.3 for improved functionality
chore(pro-extension-test.yml): update sonar-pull-request.yml version to v0.4.3 for improved functionality
  • Loading branch information
jandroav authored Sep 19, 2023
1 parent 08672cf commit a1e8087
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
sonar:
uses: liquibase/build-logic/.github/workflows/sonar-push.yml@v0.4.2
uses: liquibase/build-logic/.github/workflows/sonar-push.yml@v0.4.3
secrets: inherit

create-release:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/extension-attach-artifact-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:

- name: Get Reusable Script Files
run: |
curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/.github/get_draft_release.sh
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/.github/sign_artifact.sh
curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/.github/upload_asset.sh
curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.3/.github/get_draft_release.sh
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.3/.github/sign_artifact.sh
curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.3/.github/upload_asset.sh
chmod +x $PWD/.github/get_draft_release.sh
chmod +x $PWD/.github/sign_artifact.sh
chmod +x $PWD/.github/upload_asset.sh
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Get upload_zip.sh Script File
if: inputs.zip == 'true'
run: |
curl -o $PWD/.github/upload_zip.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/.github/upload_zip.sh
curl -o $PWD/.github/upload_zip.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.3/.github/upload_zip.sh
chmod +x $PWD/.github/upload_zip.sh
- name: Attach Zip File to Draft Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/extension-release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ jobs:
maven-release:
needs: release
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.4.2
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.4.3
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/os-extension-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ jobs:
sonar-pr:
needs: [ unit-test ]
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.4.2
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.4.3
secrets: inherit
8 changes: 4 additions & 4 deletions .github/workflows/package-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ jobs:
# Under the src folder is where specific packages files live. The GitHub action inputs will modify the universal package-deb-pom.xml to tell the process which assets to use during the packaging step
mkdir -p $PWD/.github/src/${{ inputs.artifactId }}/deb/control
mkdir -p $PWD/.github/src/${{ inputs.artifactId }}/main/archive
curl -o $PWD/.github/src/${{ inputs.artifactId }}/deb/control/control https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/src/${{ inputs.artifactId }}/deb/control/control
curl -o $PWD/.github/src/${{ inputs.artifactId }}/deb/control/postinst https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/src/${{ inputs.artifactId }}/deb/control/postinst
curl -o $PWD/.github/src/${{ inputs.artifactId }}/main/archive/${{ inputs.artifactId }}-env.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/src/${{ inputs.artifactId }}/main/archive/${{ inputs.artifactId }}-env.sh
curl -o $PWD/.github/package-deb-pom.xml https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/.github/package-deb-pom.xml
curl -o $PWD/.github/src/${{ inputs.artifactId }}/deb/control/control https://raw.githubusercontent.com/liquibase/build-logic/v0.4.3/src/${{ inputs.artifactId }}/deb/control/control
curl -o $PWD/.github/src/${{ inputs.artifactId }}/deb/control/postinst https://raw.githubusercontent.com/liquibase/build-logic/v0.4.3/src/${{ inputs.artifactId }}/deb/control/postinst
curl -o $PWD/.github/src/${{ inputs.artifactId }}/main/archive/${{ inputs.artifactId }}-env.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.3/src/${{ inputs.artifactId }}/main/archive/${{ inputs.artifactId }}-env.sh
curl -o $PWD/.github/package-deb-pom.xml https://raw.githubusercontent.com/liquibase/build-logic/v0.4.3/.github/package-deb-pom.xml
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pom-release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ jobs:
maven-release:
needs: release
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.4.2
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.4.3
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/pro-extension-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ jobs:
sonar-pr:
needs: [ unit-test ]
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.4.2
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.4.3
secrets: inherit
173 changes: 133 additions & 40 deletions .github/workflows/sonar-test-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,27 @@ on:
description: 'The maven arguments to be passed to the mvn command'
type: string
required: false
default: -Dsonar.coverage.exclusions='**/test/**/*.*, **/pom.xml'
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
testedClassesModuleName:
description: 'The name of the tested classes module'
type: string
required: false

env:
MAVEN_VERSION: '3.8.7'

jobs:
sonar-push:
sonar-scan:
name: Sonar Scan
runs-on: macos-latest-xl
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
Expand All @@ -48,7 +61,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'temurin'
cache: 'maven'
overwrite-settings: false
Expand All @@ -58,10 +71,6 @@ jobs:
with:
maven-version: ${{ env.MAVEN_VERSION }}

- name: Install mvnd
run: |
brew install mvndaemon/homebrew-mvnd/mvnd
- name: Set up Maven settings.xml
uses: whelk-io/maven-settings-xml-action@v21
with:
Expand Down Expand Up @@ -104,58 +113,142 @@ jobs:
}
]
- name: Setup docker (missing on MacOS)
run: |
brew install docker
colima start
# For testcontainers to find the Colima socket
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
- name: Download unit tests report
uses: actions/download-artifact@v3
with:
registry: ghcr.io
username: liquibot
password: ${{ secrets.GHCR_PAT }}
name: ${{ inputs.unitTestReportArtifactName }}
path: unit-tests

- name: Install sqlplus for Integration tests
run: |
mkdir -p ~/bin/oracle
wget https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-sqlplus-macos.x64-19.8.0.0.0dbru.zip
unzip -d ~/bin/oracle instantclient-sqlplus-macos.x64-19.8.0.0.0dbru.zip
wget https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basic-macos.x64-19.8.0.0.0dbru.zip
unzip -d ~/bin/oracle instantclient-basic-macos.x64-19.8.0.0.0dbru.zip
chmod -R a+x ${HOME}/bin/oracle/instantclient_19_8/
- name: Download mssql integration tests report
if: always()
uses: actions/download-artifact@v3
with:
name: ${{ inputs.integrationTestReportArtifactName }}-mssql
path: integration-tests/mssql

- name: Download mysql integration tests report
if: always()
uses: actions/download-artifact@v3
with:
name: ${{ inputs.integrationTestReportArtifactName }}-mysql
path: integration-tests/mysql

- name: Download oracle integration tests report
if: always()
uses: actions/download-artifact@v3
with:
name: ${{ inputs.integrationTestReportArtifactName }}-oracle
path: integration-tests/oracle

- name: Download postgresql integration tests report
if: always()
uses: actions/download-artifact@v3
with:
name: ${{ inputs.integrationTestReportArtifactName }}-postgresql
path: integration-tests/postgresql

- name: Download h2 integration tests report
if: always()
uses: actions/download-artifact@v3
with:
name: ${{ inputs.integrationTestReportArtifactName }}-h2
path: integration-tests/h2

- name: Download hsqldb integration tests report
if: always()
uses: actions/download-artifact@v3
with:
name: ${{ inputs.integrationTestReportArtifactName }}-hsqldb
path: integration-tests/hsqldb

- name: Download mariadb integration tests report
if: always()
uses: actions/download-artifact@v3
with:
name: ${{ inputs.integrationTestReportArtifactName }}-mariadb
path: integration-tests/mariadb

- name: Download sqlite integration tests report
if: always()
uses: actions/download-artifact@v3
with:
name: ${{ inputs.integrationTestReportArtifactName }}-sqlite
path: integration-tests/sqlite

- name: Download firebird integration tests report
if: always()
uses: actions/download-artifact@v3
with:
name: ${{ inputs.integrationTestReportArtifactName }}-firebird
path: integration-tests/firebird

- name: Cache SonarCloud packages
if: always()
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Merge integration and unit tests reports
if: always()
run: |
mkdir ./liquibase-coverage/target
mv unit-tests/jacoco.exec ./liquibase-coverage/target/jacoco-unit.exec
if [ -d "integration-tests/mssql" ]; then
mv integration-tests/mssql/jacoco.exec ./liquibase-coverage/target/jacoco-mssql-aggregate.exec
fi
if [ -d "integration-tests/mysql" ]; then
mv integration-tests/mysql/jacoco.exec ./liquibase-coverage/target/jacoco-mysql-aggregate.exec
fi
if [ -d "integration-tests/oracle" ]; then
mv integration-tests/oracle/jacoco.exec ./liquibase-coverage/target/jacoco-oracle-aggregate.exec
fi
if [ -d "integration-tests/postgresql" ]; then
mv integration-tests/postgresql/jacoco.exec ./liquibase-coverage/target/jacoco-postgresql-aggregate.exec
fi
if [ -d "integration-tests/h2" ]; then
mv integration-tests/h2/jacoco.exec ./liquibase-coverage/target/jacoco-h2-aggregate.exec
fi
if [ -d "integration-tests/hsqldb" ]; then
mv integration-tests/hsqldb/jacoco.exec ./liquibase-coverage/target/jacoco-hsqldb-aggregate.exec
fi
if [ -d "integration-tests/mariadb" ]; then
mv integration-tests/mariadb/jacoco.exec ./liquibase-coverage/target/jacoco-mariadb-aggregate.exec
fi
if [ -d "integration-tests/sqlite" ]; then
mv integration-tests/sqlite/jacoco.exec ./liquibase-coverage/target/jacoco-sqlite-aggregate.exec
fi
if [ -d "integration-tests/firebird" ]; then
mv integration-tests/firebird/jacoco.exec ./liquibase-coverage/target/jacoco-firebird-aggregate.exec
fi
mvn -B verify -P 'unit,!run-proguard' -Dliquibase.version=${{ inputs.liquibaseBranchName }}-SNAPSHOT -T 1C
wget -q https://github.com/jacoco/jacoco/releases/download/v0.8.10/jacoco-0.8.10.zip
unzip ./jacoco-0.8.10.zip
mv ./lib/jacococli.jar ./liquibase-coverage/target/jacococli.jar
chmod +x ./liquibase-coverage/target/jacococli.jar
cd liquibase-coverage
mvn jacoco:merge@cli-merge-results
cd ./target
java -jar jacococli.jar report aggregate.exec --classfiles=../../${{ inputs.testedClassesModuleName }}/target/classdumps
- name: Sonar Scan
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.PRO_LICENSE_KEY }}
run: |
export LD_LIBRARY_PATH=${HOME}/bin/oracle/instantclient_19_8:${LD_LIBRARY_PATH}
export PATH=${LD_LIBRARY_PATH}:${PATH}
export NLS_LANG=AMERICAN_AMERICA.UTF8
export SQLPATH=${HOME}/bin/oracle/instantclient_19_8
export PATH=$PATH:${HOME}/bin/oracle/instantclient_19_8
ORACLE_HOME=$ORACLE_HOME:${HOME}/bin/oracle/instantclient_19_8
source ~/.bash_profile
mvnd -B clean verify sonar:sonar -P 'testAll,!run-proguard' -Dliquibase.version=${{ inputs.liquibaseBranchName }}-SNAPSHOT \
mvn -B package sonar:sonar -P '!run-proguard' -DskipTests -Dliquibase.version=${{ inputs.liquibaseBranchName }}-SNAPSHOT \
${{ inputs.mavenArgs }} \
-Dsonar.scm.revision=${{ inputs.thisSha }} \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.token=$SONAR_TOKEN \
-Dsonar.java.coveragePlugin=jacoco \
-Dsonar.branch.name=${{ inputs.thisBranchName }} \
-Dsonar.pullrequest.key=${{ inputs.pullRequestNumber }} \
-Dsonar.pullrequest.branch=${{ inputs.pullRequestBranchName }} \
-Dsonar.branch.name=${{ inputs.thisBranchName}} \
-Dsonar.pullrequest.key=${{ inputs.pullRequestNumber}} \
-Dsonar.pullrequest.branch=${{ inputs.pullRequestBranchName}} \
-Dsonar.pullrequest.base=${{ inputs.pullRequestBaseBranchName }} \
-Dsonar.pullrequest.provider=GitHub \
-Dsonar.pullrequest.github.repository="${{ github.repository }}" \
Expand Down

0 comments on commit a1e8087

Please sign in to comment.