diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cf9d9f9..87ac210 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -94,6 +94,9 @@ jobs: name: PHP ${{ matrix.php }} - ${{ matrix.db }} + outputs: + has-tests: ${{ steps.check-unit-tests.outputs.exists }} + steps: - name: Checkout phpBB uses: actions/checkout@v4 @@ -107,6 +110,16 @@ jobs: with: path: phpBB4/phpBB/ext/${{ env.EXTNAME }} + - name: Check for unit tests + id: check-unit-tests + run: | + if [ -d "tests" ]; then + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + fi + working-directory: ./phpBB4/phpBB/ext/${{ env.EXTNAME }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -152,7 +165,8 @@ jobs: # START MySQL and MariaDB Job mysql-tests: - if: ${{ inputs.RUN_MYSQL_JOBS == '1' }} + needs: basic-checks + if: ${{ inputs.RUN_MYSQL_JOBS == '1' && needs.basic-checks.outputs.has-tests == 'true' }} runs-on: ubuntu-latest strategy: matrix: @@ -335,7 +349,8 @@ jobs: # START PostgreSQL Job postgres-tests: - if: ${{ inputs.RUN_PGSQL_JOBS == '1' }} + needs: basic-checks + if: ${{ inputs.RUN_PGSQL_JOBS == '1' && needs.basic-checks.outputs.has-tests == 'true' }} runs-on: ubuntu-latest strategy: matrix: @@ -485,7 +500,8 @@ jobs: # START Other Tests Job (SQLite 3 and mssql) other-tests: - if: ${{ inputs.RUN_MSSQL_JOBS == '1' }} + needs: basic-checks + if: ${{ inputs.RUN_MSSQL_JOBS == '1' && needs.basic-checks.outputs.has-tests == 'true' }} runs-on: ubuntu-22.04 strategy: matrix: @@ -632,7 +648,8 @@ jobs: # Test with IIS & PostgreSQL on Windows windows-tests: - if: ${{ inputs.RUN_WINDOWS_JOBS == '1' }} + needs: basic-checks + if: ${{ inputs.RUN_WINDOWS_JOBS == '1' && needs.basic-checks.outputs.has-tests == 'true' }} runs-on: windows-latest strategy: matrix: