From c89c2253fd8643a2f8732940496adaba7bdb8e76 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Thu, 10 Mar 2022 13:17:01 +0000 Subject: [PATCH] Add test coverage reporting (#8009) --- .github/codecov.yml | 6 ++++++ .github/workflows/test_coverage.yml | 25 +++++++++++++++++++++++++ package.json | 3 ++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/codecov.yml create mode 100644 .github/workflows/test_coverage.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000000..0cd4cec72d --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,6 @@ +comment: + layout: "diff, files" + behavior: default + require_changes: false + require_base: no + require_head: no diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml new file mode 100644 index 0000000000..1153e24f75 --- /dev/null +++ b/.github/workflows/test_coverage.yml @@ -0,0 +1,25 @@ +name: Test coverage +on: + pull_request: {} + push: + branches: [develop, main, master] +jobs: + test-coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Yarn cache + uses: c-hive/gha-yarn-cache@v2 + + - name: Install Deps + run: "./scripts/ci/install-deps.sh --ignore-scripts" + + - name: Run tests with coverage + run: "yarn install && yarn reskindex && yarn coverage" + + - name: Upload coverage + uses: codecov/codecov-action@v2 + with: + verbose: true diff --git a/package.json b/package.json index 957982c474..0ccb0990ed 100644 --- a/package.json +++ b/package.json @@ -231,7 +231,8 @@ "/src/**/*.{js,ts,tsx}" ], "coverageReporters": [ - "text" + "text", + "json" ] } }