Skip to content

Commit

Permalink
Merge pull request moodlehq#86 from stronk7/move_always_to_cancelled
Browse files Browse the repository at this point in the history
GHA: Move from always() to !cancelled()
  • Loading branch information
stronk7 authored Jan 11, 2024
2 parents 9e3dcb0 + 66cf4ff commit 0cfc3d8
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,25 @@ jobs:
composer install
- name: Run phplint
if: ${{ always() }}
if: ${{ !cancelled() }}
run: |
./vendor/bin/phplint
- name: PHP Copy/Paste Detector
if: ${{ always() }}
if: ${{ !cancelled() }}
run: ./vendor/bin/phpcpd --exclude moodle/Tests moodle

- name: Run phpunit
if: ${{ always() }}
if: ${{ !cancelled() }}
run: |
./vendor/bin/phpunit --coverage-text
- name: Test coverage
if: ${{ !cancelled() }}
run: ./vendor/bin/phpunit-coverage-check -t 80 clover.xml

- name: Integration tests
if: ${{ always() }}
if: ${{ !cancelled() }}
run: |
# There is one failure (exit with error)
vendor/bin/phpcs --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt || [[ $? = 1 ]]
Expand All @@ -62,6 +63,11 @@ jobs:
# 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 ]]
- name: Mark cancelled jobs as failed
if: ${{ cancelled() }}
run: exit 1

coverage:
if: github.repository == 'moodlehq/moodle-cs'
name: Code coverage (codecov)
Expand All @@ -84,12 +90,17 @@ jobs:
composer install
- name: Run phpunit
if: ${{ always() }}
if: ${{ !cancelled() }}
run: |
./vendor/bin/phpunit --coverage-clover clover.xml
- name: Upload coverage
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v3
with:
files: clover.xml
verbose: true

- name: Mark cancelled jobs as failed
if: ${{ cancelled() }}
run: exit 1

0 comments on commit 0cfc3d8

Please sign in to comment.