generated from kestra-io/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cicd): missing jacoco & solace
- Loading branch information
1 parent
5a68a2b
commit d5b003c
Showing
1 changed file
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,21 @@ on: | |
branches: | ||
- master | ||
|
||
workflow_dispatch: {} | ||
workflow_dispatch: | ||
inputs: | ||
skip-test: | ||
description: 'Skip test' | ||
required: false | ||
type: string | ||
default: "false" | ||
|
||
jobs: | ||
check: | ||
name: Check & Publish | ||
runs-on: ubuntu-latest | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -43,11 +50,51 @@ jobs: | |
java-version: 21 | ||
|
||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v2 | ||
uses: gradle/actions/wrapper-validation@v4 | ||
|
||
# Gradle check | ||
- name: Build with Gradle | ||
run: ./gradlew check --refresh-dependencies | ||
if: ${{ github.event.inputs.skip-test == 'false' || github.event.inputs.skip-test == '' }} | ||
env: | ||
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | ||
run: | | ||
echo $GOOGLE_SERVICE_ACCOUNT | base64 -d > src/test/resources/.gcp-service-account.json | ||
./gradlew check | ||
# Allure check | ||
- name: Auth to Google Cloud | ||
id: auth | ||
if: ${{ always() && env.GOOGLE_SERVICE_ACCOUNT != 0 }} | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
credentials_json: '${{ secrets.GOOGLE_SERVICE_ACCOUNT }}' | ||
|
||
- uses: rlespinasse/github-slug-action@v4 | ||
|
||
- name: Publish allure report | ||
uses: andrcuns/[email protected] | ||
if: ${{ always() && env.GOOGLE_SERVICE_ACCOUNT != 0 && (github.event.inputs.skip-test == 'false' || github.event.inputs.skip-test == '') }} | ||
env: | ||
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
JAVA_HOME: /usr/lib/jvm/default-jvm/ | ||
with: | ||
storageType: gcs | ||
resultsGlob: build/allure-results | ||
bucket: internal-kestra-host | ||
baseUrl: "https://internal.kestra.io" | ||
prefix: ${{ format('{0}/{1}', github.repository, 'allure/java') }} | ||
copyLatest: true | ||
ignoreMissingResults: true | ||
|
||
# Jacoco | ||
- name: 'Set up Cloud SDK' | ||
if: ${{ env.GOOGLE_SERVICE_ACCOUNT != 0 }} | ||
uses: 'google-github-actions/setup-gcloud@v2' | ||
|
||
- name: 'Copy jacoco files' | ||
if: ${{ env.GOOGLE_SERVICE_ACCOUNT != 0 }} | ||
run: | | ||
gsutil -m rsync -d -r build/reports/jacoco/test/ gs://internal-kestra-host/${{ format('{0}/{1}', github.repository, 'jacoco') }} | ||
# Publish | ||
- name: Publish package to Sonatype | ||
|