Skip to content

Commit

Permalink
chore(cicd): missing jacoco & solace
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Oct 28, 2024
1 parent 5a68a2b commit d5b003c
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit d5b003c

Please sign in to comment.