Skip to content

Commit

Permalink
Merge pull request #3 from konvenit/codecoverage
Browse files Browse the repository at this point in the history
add code_coverage
  • Loading branch information
stereosupersonic authored Jul 13, 2023
2 parents c351672 + 8e25eb4 commit 71db798
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/compose_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
tag:
required: true
type: string
code_coverage:
required: false
type: boolean
default: false
cmd:
required: true
type: string
Expand All @@ -19,6 +23,7 @@ on:
required: true
env:
TAG: ${{ inputs.tag }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

jobs:
compose_run:
Expand Down Expand Up @@ -67,9 +72,16 @@ jobs:
if [ "$STATUS" != "healthy" ]; then echo "${{ inputs.application-name }} is not healthy"; docker-compose -f docker-compose.test.yml ps; exit 1; fi
- name: Run command
if: ${{ !inputs.code_coverage }}
run: |
docker-compose -f docker-compose.test.yml exec -T ${{ inputs.application-name }} ${{ inputs.cmd}}
- name: Run command with code coverage
if: ${{ inputs.code_coverage }}
run: |
ci_env=`bash <(curl -s https://codecov.io/env)`
docker-compose -f docker-compose.test.yml exec -T -e CI=true $ci_env ${{ inputs.application-name }} ${{ inputs.cmd}}
- name: Stop containers
if: always()
run: docker-compose -f docker-compose.test.yml down

0 comments on commit 71db798

Please sign in to comment.