From 06fe70b513a863b065064df843d1a98cd6b61d40 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/phpunit.yml | 27 +++++++++++++++++++++++++++ codecov.yml | 9 +++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/phpunit.yml create mode 100644 codecov.yml diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..1436281 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,27 @@ +name: PHPUnit Tests + +on: push + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run PHPUnit tests with coverage + run: vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true 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%