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-18326: renaming main.yml to test.yml #867

Closed
wants to merge 14 commits into from
13 changes: 10 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: Create Release

on:
workflow_dispatch:
push:
branches:
- main

jobs:
create-release:
uses: liquibase/build-logic/.github/workflows/[email protected]
secrets: inherit
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Create Release Draft
id: create-release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Sonar Scan

on:
workflow_dispatch:
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
sonar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'

- name: Sonar Branch Scan
if: always() && !github.event.pull_request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.PRO_LICENSE_KEY }}
run: |
mvn -B sonar:sonar -P 'sonar,!run-proguard' -DskipTests -Dliquibase.version=${{ github.ref }}-SNAPSHOT \
-Dsonar.scm.revision=${{ github.sha }} \
-Dsonar.token=$SONAR_TOKEN \
-Dsonar.java.coveragePlugin=jacoco \
-Dsonar.branch.name=${{ github.ref }} \
-Dsonar.qualitygate.wait=true \
-Dsonar.organization=${{ github.repository_owner }} \
-Dsonar.host.url='https://sonarcloud.io' \
-Dsonar.scm.provider=git \
-Daws.region="us-east-1"

- name: Sonar PR Scan
if: always() && github.event.pull_request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.PRO_LICENSE_KEY }}
run: |
mvn -B sonar:sonar -P 'sonar,!run-proguard' -DskipTests -Dliquibase.version=${{ github.ref }}-SNAPSHOT \
${{ inputs.mavenArgs }} \
-Dsonar.scm.revision=${{ github.sha }} \
-Dsonar.token=$SONAR_TOKEN \
-Dsonar.java.coveragePlugin=jacoco \
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} \
-Dsonar.pullrequest.provider=GitHub \
-Dsonar.pullrequest.github.repository="${{ github.repository }}" \
-Dsonar.pullrequest.github.endpoint='https://api.github.com/' \
-Dsonar.qualitygate.wait=true \
-Dsonar.organization=${{ github.repository_owner }} \
-Dsonar.host.url='https://sonarcloud.io' \
-Dsonar.scm.provider=git \
-Daws.region="us-east-1"
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,26 @@
<targetBytecode>1.8</targetBytecode>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
Loading