diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml new file mode 100644 index 000000000..b0e94db22 --- /dev/null +++ b/.github/workflows/code-coverage.yml @@ -0,0 +1,35 @@ +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: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Setup the serve environment + shell: bash -l {0} + run: | + bash setup/setup_serve.sh + + - name: Run Jest tests + shell: bash -l {0} + run: | + source setup/activate_serve.sh + 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' }} + \ No newline at end of file diff --git a/.github/workflows/serve-install.yml b/.github/workflows/serve-install.yml index f7902b2ea..3c42514e5 100644 --- a/.github/workflows/serve-install.yml +++ b/.github/workflows/serve-install.yml @@ -59,18 +59,6 @@ jobs: echo "ionic version" npx ionic --version - - name: Run Jest tests - shell: bash -l {0} - 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