From 33ae0bc01ac309f53f4bcb4ff98ecea272c966f9 Mon Sep 17 00:00:00 2001 From: Vincent Gao Date: Mon, 22 Jul 2024 13:31:57 +1000 Subject: [PATCH] test for github code coverage --- .github/workflows/build.yml | 32 +++++++++++++++++++++++++++++++- codecov.yml | 9 +++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 codecov.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45eee5e..17b74e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: build on: push - + jobs: set_status_in_progress: name: set_status_in_progress @@ -20,6 +20,36 @@ jobs: with: module_build: true runner: biggy-tide + + phpunit_coverage: + name: PHPUnit Tests and Coverage + needs: tide_build + runs-on: biggy-tide + steps: + - name: Change to project directory + run: cd $GITHUB_WORKSPACE + + - name: Debug information + run: | + pwd + ls -la + which phpdbg + which php + which phpunit + + - name: Check PHP and phpdbg versions + run: | + php --version + phpdbg --version + + - name: Run PHPUnit tests with coverage + run: phpdbg -qrr $(which phpunit) /home/runner/work/tide_search/tide_search/dpc-sdp --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true export_config: name: export_config secrets: inherit diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..cdb5911 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,9 @@ +coverage: + status: + project: + default: + target: 80% + threshold: 5% + patch: + default: + target: 80%