Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA: Move from always() to !cancelled() #86

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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