Skip to content

Commit

Permalink
DAT-16000



 liquibase-redshift using Liquibase Parent POM (#98)
Browse files Browse the repository at this point in the history
* chore(sonar-pull-request.yml): add steps to download test results artifact and get artifact ID

The changes in this commit add two new steps to the Sonar Pull Request workflow.

1. The first step is to get the artifact ID using the Maven command `mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout`. The output of this command is stored in the environment variable `artifact_id` using the `echo` command.

2. The second step is to download the test results artifact using the `dawidd6/action-download-artifact` action. This step downloads the artifact with the name `${{ env.artifact_id }}-artifacts` from the workflow `test.yml` in the current repository. The downloaded artifact is saved in the `./target` directory. If no artifact is found, a warning is issued.

These changes are made to enhance the Sonar Scan process by providing the necessary artifacts and information for analysis.

* chore(sonar-pull-request.yml): update SonarQube command to include package step and skip tests

The SonarQube command in the workflow file has been updated to include a package step and skip tests. This change was made to improve the efficiency of the SonarQube analysis by skipping unnecessary test execution during the analysis process.

* chore(create-release.yml): update sonar-push.yml version to v0.4.9 for better compatibility and bug fixes
chore(extension-attach-artifact-release.yml): update get_draft_release.sh, sign_artifact.sh, and upload_asset.sh versions to v0.4.9 for better compatibility and bug fixes
chore(extension-release-prepare.yml): update extension-release-rollback.yml version to v0.4.9 for better compatibility and bug fixes
chore(extension-release-published.yml): update extension-release-prepare.yml version to v0.4.9 for better compatibility and bug fixes
chore(os-extension-test.yml): update sonar-pull-request.yml version to v0.4.9 for better compatibility and bug fixes
chore(package-deb.yml): update package-deb-pom.xml and other script versions to v0.4.9 for better compatibility and bug fixes
chore(pom-release-published.yml): update extension-release-prepare.yml version to v0.4.9 for better compatibility and bug fixes
chore(pro-extension-test.yml): update sonar-pull-request.yml version to v0.4.9 for better compatibility and bug fixes
  • Loading branch information
jandroav committed Oct 13, 2023
1 parent eaf718c commit 2df68f7
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 15 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.8
uses: liquibase/build-logic/.github/workflows/sonar-push.yml@v0.4.9
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.8/.github/get_draft_release.sh
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.8/.github/sign_artifact.sh
curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.8/.github/upload_asset.sh
curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.9/.github/get_draft_release.sh
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.9/.github/sign_artifact.sh
curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.9/.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 @@ -115,7 +115,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.8/.github/upload_zip.sh
curl -o $PWD/.github/upload_zip.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.9/.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-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ jobs:
release-rollback:
needs: prepare-release
if: ${{ always() && contains(needs.*.result, 'failure') }}
uses: liquibase/build-logic/.github/workflows/extension-release-rollback.yml@v0.4.8
uses: liquibase/build-logic/.github/workflows/extension-release-rollback.yml@v0.4.9
secrets: inherit
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.8
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.4.9
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.8
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.4.9
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.8/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.8/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.8/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.8/.github/package-deb-pom.xml
curl -o $PWD/.github/src/${{ inputs.artifactId }}/deb/control/control https://raw.githubusercontent.com/liquibase/build-logic/v0.4.9/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.9/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.9/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.9/.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.8
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.4.9
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 @@ -204,5 +204,5 @@ jobs:
sonar-pr:
needs: [ unit-test ]
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.4.8
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.4.9
secrets: inherit
18 changes: 17 additions & 1 deletion .github/workflows/sonar-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Get Artifact ID
id: get-artifact-id
run: echo "artifact_id=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)" >> $GITHUB_ENV

- name: Download Test Results Artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.BOT_TOKEN}}
workflow: test.yml
name: ${{ env.artifact_id }}-artifacts
repo: ${{ github.repository }}
path: ./target
if_no_artifact_found: warn
workflow_conclusion: ""

- name: Sonar Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -47,4 +63,4 @@ jobs:
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} \
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} \
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
clean verify sonar:sonar
package -DskipTests sonar:sonar

0 comments on commit 2df68f7

Please sign in to comment.