From d664780c67ad0d928f5468c1c5fccb333ece8b5f Mon Sep 17 00:00:00 2001 From: Vincent QUATREVIEUX Date: Tue, 14 Mar 2023 13:58:01 +0100 Subject: [PATCH] ci: Setup codecov (#FRAM-111) --- .github/workflows/php.yml | 33 +++++++++++++++++++++++++++++++++ .scrutinizer.yml | 22 ---------------------- README.md | 3 +-- codecov.yml | 15 +++++++++++++++ 4 files changed, 49 insertions(+), 24 deletions(-) delete mode 100644 .scrutinizer.yml create mode 100644 codecov.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 11b208c..914e1f5 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -76,3 +76,36 @@ jobs: - name: Run type coverage run: composer run-script psalm + + coverage: + name: Code coverage + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set Timezone + uses: szenius/set-timezone@v1.0 + with: + timezoneLinux: "Europe/Paris" + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + extensions: json + ini-values: date.timezone=Europe/Paris + + - name: Install MySQL + run: ./.github/run-mysql.sh + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test coverage + run: ./vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: coverage.xml diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 18473c2..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,22 +0,0 @@ -build: - environment: - php: 7.2.24 - timezone: Europe/Paris - - nodes: - tests: - environment: - docker: true - - dependencies: - before: - - sudo service mysql start || true - - sudo service mysql stop || true - - ./.github/run-mysql.sh - - tests: - override: - - command: composer run tests-with-coverage - coverage: - file: coverage.xml - format: clover diff --git a/README.md b/README.md index d6c5e64..7f5de5c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Prime Events [![build](https://github.com/b2pweb/bdf-prime-events/actions/workflows/php.yml/badge.svg)](https://github.com/b2pweb/bdf-prime-events/actions/workflows/php.yml) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/b2pweb/bdf-prime-events/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/b2pweb/bdf-prime-events/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/b2pweb/bdf-prime-events/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/b2pweb/bdf-prime-events/?branch=master) +[![codecov](https://codecov.io/github/b2pweb/bdf-prime-events/branch/2.0/graph/badge.svg?token=VOFSPEWYKX)](https://app.codecov.io/github/b2pweb/bdf-prime-events) [![Packagist Version](https://img.shields.io/packagist/v/b2pweb/bdf-prime-events.svg)](https://packagist.org/packages/b2pweb/bdf-prime-events) [![Total Downloads](https://img.shields.io/packagist/dt/b2pweb/bdf-prime-events.svg)](https://packagist.org/packages/b2pweb/bdf-prime-events) [![Type Coverage](https://shepherd.dev/github/b2pweb/bdf-prime-events/coverage.svg)](https://shepherd.dev/github/b2pweb/bdf-prime-events) diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..5763710 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,15 @@ +codecov: + require_ci_to_pass: false + notify: + wait_for_ci: false + +coverage: + status: + project: + default: + target: auto + threshold: 1% + patch: + default: + # basic + target: 95%