Skip to content

Commit

Permalink
CI: Run test stage once tests exist
Browse files Browse the repository at this point in the history
  • Loading branch information
justusdieckmann committed Feb 16, 2022
1 parent 1191af5 commit 5113f48
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
static:
runs-on: ubuntu-latest

outputs:
has_tests: ${{ steps.check_tests.outputs.has_tests }}

strategy:
matrix:
php: ['7.4']
Expand All @@ -21,6 +24,11 @@ jobs:
with:
path: plugin

- name: Check for test folder
id: check_tests
run: |
echo "::set-output name=has_tests::${{ hashFiles('plugin/tests') != '' }}"
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
Expand Down Expand Up @@ -81,7 +89,6 @@ jobs:
- name: Moodle PHPDoc Checker
if: ${{ always() }}
run: moodle-plugin-ci phpdoc
continue-on-error: true

- name: Validating
if: ${{ always() }}
Expand All @@ -94,7 +101,6 @@ jobs:
- name: Mustache Lint
if: ${{ always() }}
run: moodle-plugin-ci mustache
continue-on-error: true

- name: Grunt
if: ${{ always() }}
Expand All @@ -103,7 +109,7 @@ jobs:
test:
runs-on: ubuntu-latest
needs: static
if: ${{ false }}
if: ${{ needs.static.outputs.has_tests == 'true' }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -171,4 +177,4 @@ jobs:

- name: Behat features
if: ${{ always() }}
run: moodle-plugin-ci behat --profile chrome
run: moodle-plugin-ci behat --profile chrome

0 comments on commit 5113f48

Please sign in to comment.