Skip to content

Commit

Permalink
run coverage workflow only when PR is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
jiji14 committed Dec 5, 2023
1 parent c1f6dc3 commit abc88bd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: code coverage
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
run-codecov:
if: github.event.pull_request.draft == false
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "21"

- name: Install dependencies
run: npm install jest

- name: Run Jest tests
run: npm run test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/coverage-final.json
flags: unit
fail_ci_if_error: ${{ github.repository == 'e-mission/e-mission-phone' }}

7 changes: 0 additions & 7 deletions .github/workflows/serve-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ jobs:
run: |
npx jest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/coverage-final.json
flags: unit
fail_ci_if_error: ${{ github.repository == 'e-mission/e-mission-phone' }}

# TODO: figure out how to check that a server started correctly
# - name: Try starting it
# run: npx run serve
Expand Down

0 comments on commit abc88bd

Please sign in to comment.