Skip to content

Commit

Permalink
infection
Browse files Browse the repository at this point in the history
  • Loading branch information
rdebleu committed Dec 9, 2024
1 parent 226f7d9 commit 1fdafe0
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/infection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Tests

on: [push, pull_request]

jobs:
ci:
name: infection
runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
options: --health-cmd="pg_isready" --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432

strategy:
fail-fast: false
matrix:
moodle-branch: [main]
php: [8.3]
database: [pgsql]

steps:
- name: checkout plugin
uses: actions/checkout@v4
with:
path: this-plugin

- name: setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: max_input_vars=5000
tools: infection, phpunit
coverage: pcov

- name: composer
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
- name: install Moodle
run: moodle-plugin-ci install --db-host=127.0.0.1 --plugin this-plugin
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}

- name: autoload
working-directory: moodle
run: |
echo '<?php' > vendor/autoloadmoodle.php
echo 'define("PHPUNIT_UTIL", true);' >> vendor/autoloadmoodle.php
echo 'require(__DIR__ . "/../lib/phpunit/bootstrap.php");' >> vendor/autoloadmoodle.php
echo 'require("autoload.php");' >> vendor/autoloadmoodle.php
- name: infection
if: ${{ !cancelled() }}
run: infection -s --only-covered --configuration=enrol/coursecompleted/.infection.json5
working-directory: moodle

0 comments on commit 1fdafe0

Please sign in to comment.