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
Show file tree
Hide file tree
Changes from all commits
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
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