Skip to content

Commit

Permalink
chore(tests): Migrate code coverage generation from drone to GitHub
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Oct 20, 2023
1 parent aab6946 commit dab6424
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 66 deletions.
64 changes: 0 additions & 64 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1360,70 +1360,6 @@ trigger:
- pull_request
- push

---
kind: pipeline
name: nodb-codecov

steps:
- name: submodules
image: ghcr.io/nextcloud/continuous-integration-alpine-git:latest
commands:
- git submodule update --init
- name: nodb-codecov
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
environment:
CODECOV_TOKEN:
from_secret: CODECOV_TOKEN
XDEBUG_MODE: coverage
commands:
- phpenmod xdebug
- TEST_SELECTION=NODB ./autotest.sh sqlite
- wget https://codecov.io/bash -O codecov.sh
- bash codecov.sh -Z -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml

services:
- name: cache
image: ghcr.io/nextcloud/continuous-integration-redis:latest

trigger:
branch:
- master
- stable*
event:
- push

---
kind: pipeline
name: db-codecov

steps:
- name: submodules
image: ghcr.io/nextcloud/continuous-integration-alpine-git:latest
commands:
- git submodule update --init
- name: db-codecov
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
environment:
CODECOV_TOKEN:
from_secret: CODECOV_TOKEN
XDEBUG_MODE: coverage
commands:
- phpenmod xdebug
- TEST_SELECTION=QUICKDB ./autotest.sh sqlite
- wget https://codecov.io/bash -O codecov.sh
- bash codecov.sh -Z -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml

services:
- name: cache
image: ghcr.io/nextcloud/continuous-integration-redis:latest

trigger:
branch:
- master
- stable*
event:
- push

---
kind: pipeline
name: object-store-s3
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/phpunit-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
include:
- php-versions: '8.3'
database-only: false
coverage: true

name: SQLite (PHP ${{ matrix.php-versions }}) - ${{ matrix.database-only && 'database' || 'all' }} tests

Expand All @@ -80,7 +81,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: none
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -103,7 +104,15 @@ jobs:

- name: PHPUnit full testsuite
if: ${{ ! matrix.database-only }}
run: composer run test
run: composer run test ${{ matrix.coverage && ' -- --coverage-clover ./clover.xml' || '' }}

- name: Upload code coverage
if: ${{ !cancelled() && matrix.coverage }}
uses: codecov/codecov-action@v3
with:
files: ./clover.xml
fail_ci_if_error: true
flags: unit

- name: Print logs
if: always()
Expand Down

0 comments on commit dab6424

Please sign in to comment.