Skip to content

Commit

Permalink
chore: better codecov usage
Browse files Browse the repository at this point in the history
Will fire iff there are changes in /src or /tests
  • Loading branch information
aviadhahami committed Jul 19, 2023
1 parent 098cb0a commit 21b5f84
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,16 @@ jobs:
run: docker build -t tests:${{ github.sha }} --build-arg SET_NODE_VERSION=$NODE_VERSION .
- name: Invoke testing container
run: docker run --network container:vault
-e VAULT_ADDR=http://vault:8200
-e VAULT_ADDR=$VAULT_ADDR
-v $PWD/coverage:/app/coverage tests:${{ github.sha }} "cd /app && npm run coverage"
- uses: codecov/codecov-action@v3
env:
VAULT_ADDR: http://vault:8200
- name: Check for changes in src and tests
id: check_changes
run: echo ::set-output name=changed::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E 'src/|tests/')
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # tag: 3.1.4
# only changes under path src or test will be reported
if: steps.check_changes.outputs.changed
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: NODE_VERSION # optional
Expand Down

0 comments on commit 21b5f84

Please sign in to comment.