Skip to content

Merge pull request #14605 from jeabakker/release-6.0.0-beta.1 #1194

Merge pull request #14605 from jeabakker/release-6.0.0-beta.1

Merge pull request #14605 from jeabakker/release-6.0.0-beta.1 #1194

Workflow file for this run

name: Code Coverage
on: [push]
env:
ELGG_DB_USER: root
ELGG_DB_PASS: password
ELGG_DB_NAME: elgg
ELGG_DB_PREFIX: elgg_
ELGG_DB_HOST: 127.0.0.1
jobs:
scrutinizer:
name: Scrutinizer - ${{ matrix.testsuite }}
runs-on: ubuntu-20.04
services:
elggdb:
image: 'mysql:8.0'
env:
MYSQL_DATABASE: elgg
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
strategy:
fail-fast: false
matrix:
# Keep number of suites inline with Scrutinizer waiting for the same amount of coverage runs
testsuite: ['unit', 'integration-a-to-d', 'integration-e-to-s', 'integration-t-to-all', 'plugins-unit', 'plugins-integration-generic', 'plugins-integration']
steps:
- name: Check if run on the Elgg repo
if: github.repository != 'Elgg/Elgg'
run: exit 1
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: xdebug
extensions: gd,pdo,xml,json,mysqli,pdo_mysql,libxml,mbstring,intl
ini-values: max_execution_time=180,zend.enable_gc=0
- name: Code checkout
uses: actions/checkout@v4
with:
# Fetch 10 commits or Scrutinizer will throw ("Failed to retrieve commit parents. If you use a shallow git checkout, please checkout at least a depth of one."), see: RepositoryIntrospector at scrutinizer-ci/ocular GitHub repository
# 10 commits is an arbitrary value that is more than 1 commit
fetch-depth: 10
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> ${GITHUB_OUTPUT}
- name: Restore Composer Cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Composer install
run: composer install
- name: Install Elgg
run: php ./elgg-cli install --config ./install/cli/testing_app.php --verbose --no-ansi
- name: Enable Elgg plugins
run: |
php ./elgg-cli plugins:activate activity blog bookmarks ckeditor dashboard developers discussions externalpages file friends friends_collections garbagecollector groups invitefriends likes members messageboard messages pages profile reportedcontent search site_notifications system_log tagcloud theme_sandbox thewire uservalidationbyemail web_services custom_index:last --no-ansi
php ./elgg-cli plugins:list --no-ansi
- name: Generate code coverage
continue-on-error: true
run: ./vendor/bin/phpunit --testsuite ${{ matrix.testsuite }} --coverage-clover=coverage.clover
- name: Upload to Scrutinizer
run: ./vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover