Skip to content

Commit

Permalink
Refactor composite workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ron190 committed Jul 8, 2024
1 parent a09ceef commit 2ea5fe4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ jobs:
- name: Coverage and site
uses: ./.github/workflows/publish-scan/
if: ${{ env.IS_PUBLISHING == 'true' }}
with:
DOCKER_RESOURCES: ./model/src/test/resources/docker
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

release:
needs: [build-jdk11, build, build-additional, codeql]
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/publish-scan/action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
inputs:
DOCKER_RESOURCES:
type: string
required: true
CODECOV_TOKEN:
type: string
required: true
CODACY_PROJECT_TOKEN:
type: string
required: true

runs:
using: "composite"
steps:
- name: Copy files and coverage reports from container
shell: bash
# Sonar scans unmerged reports, Codacy/Codecov requires scanning each files (or reports merged)
run: |
mkdir -p shared-resources/site shared-resources/model shared-resources/view
Expand All @@ -11,16 +23,19 @@ runs:
docker cp docker_jsql-container:pom.xml shared-resources
- name: Codecov scan
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ inputs.CODECOV_TOKEN }}
run: cd shared-resources && bash <(curl -s https://codecov.io/bash) || true

- name: Codacy scan
shell: bash
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ inputs.CODACY_PROJECT_TOKEN }}
run: cd shared-resources && bash <(curl -Ls https://coverage.codacy.com/get.sh) || true

- name: Publish Maven site
shell: bash
run: |
git checkout docs
git config user.name "Github Actions"
Expand Down

0 comments on commit 2ea5fe4

Please sign in to comment.