diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index 58a9e08..861c294 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -22,7 +22,7 @@ jobs: with: php-version: ${{ matrix.php }} extensions: ${{ matrix.extensions }} - ini-values: pcov.directory=moodle + ini-values: pcov.directory=moodle, error_reporting=-1, display_errors=On coverage: pcov tools: composer @@ -46,3 +46,19 @@ jobs: - name: Test coverage run: ./vendor/bin/phpunit-coverage-check -t 80 clover.xml + + - name: Integration tests + if: ${{ always() }} + run: | + set +x + + # There is one failure (exit with error) + vendor/bin/phpcs --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt || [[ $? = 1 ]] + grep -q "PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY" output.txt + + # The failure is fixed (exit with error) + vendor/bin/phpcbf --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt || [[ $? = 1 ]] + grep -q "A TOTAL OF 1 ERROR WERE FIXED IN 1 FILE!" output.txt + + # So, there isn't any failure any more (exit without error) + #vendor/bin/phpcs --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt && [[ $? = 0 ]] diff --git a/moodle/Tests/fixtures/integration_test_ci.php b/moodle/Tests/fixtures/integration_test_ci.php new file mode 100644 index 0000000..fdd4434 --- /dev/null +++ b/moodle/Tests/fixtures/integration_test_ci.php @@ -0,0 +1,4 @@ +