diff --git a/.github/workflows/serve-install.yml b/.github/workflows/serve-install.yml index c78ce1f86..f7902b2ea 100644 --- a/.github/workflows/serve-install.yml +++ b/.github/workflows/serve-install.yml @@ -64,6 +64,13 @@ 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 diff --git a/.gitignore b/.gitignore index 6801f890d..bdf59df4f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ app-settings.json www/dist/ config.xml package.json +coverage/ diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..125b560ef --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +comment: + layout: " diff, flags, files" + behavior: default + require_changes: false + require_base: false + require_head: true + hide_project_coverage: false + \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index ef3503294..e00409ff1 100644 --- a/jest.config.js +++ b/jest.config.js @@ -17,4 +17,5 @@ module.exports = { moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], moduleDirectories: ["node_modules", "src"], globals: {"__DEV__": false}, + collectCoverage: true, };