Skip to content

Commit 7ad95fb

Browse files
authored
Merge pull request #57 from iMattPro/master-update
Merge 3.3.x into Master
2 parents 8ad80bc + 1d49258 commit 7ad95fb

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/tests.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ jobs:
9494

9595
name: PHP ${{ matrix.php }} - ${{ matrix.db }}
9696

97+
outputs:
98+
has-tests: ${{ steps.check-unit-tests.outputs.exists }}
99+
97100
steps:
98101
- name: Checkout phpBB
99102
uses: actions/checkout@v4
@@ -107,6 +110,16 @@ jobs:
107110
with:
108111
path: phpBB4/phpBB/ext/${{ env.EXTNAME }}
109112

113+
- name: Check for unit tests
114+
id: check-unit-tests
115+
run: |
116+
if [ -d "tests" ]; then
117+
echo "exists=true" >> "$GITHUB_OUTPUT"
118+
else
119+
echo "exists=false" >> "$GITHUB_OUTPUT"
120+
fi
121+
working-directory: ./phpBB4/phpBB/ext/${{ env.EXTNAME }}
122+
110123
- name: Setup PHP
111124
uses: shivammathur/setup-php@v2
112125
with:
@@ -152,7 +165,8 @@ jobs:
152165

153166
# START MySQL and MariaDB Job
154167
mysql-tests:
155-
if: ${{ inputs.RUN_MYSQL_JOBS == '1' }}
168+
needs: basic-checks
169+
if: ${{ inputs.RUN_MYSQL_JOBS == '1' && needs.basic-checks.outputs.has-tests == 'true' }}
156170
runs-on: ubuntu-latest
157171
strategy:
158172
matrix:
@@ -335,7 +349,8 @@ jobs:
335349

336350
# START PostgreSQL Job
337351
postgres-tests:
338-
if: ${{ inputs.RUN_PGSQL_JOBS == '1' }}
352+
needs: basic-checks
353+
if: ${{ inputs.RUN_PGSQL_JOBS == '1' && needs.basic-checks.outputs.has-tests == 'true' }}
339354
runs-on: ubuntu-latest
340355
strategy:
341356
matrix:
@@ -485,7 +500,8 @@ jobs:
485500

486501
# START Other Tests Job (SQLite 3 and mssql)
487502
other-tests:
488-
if: ${{ inputs.RUN_MSSQL_JOBS == '1' }}
503+
needs: basic-checks
504+
if: ${{ inputs.RUN_MSSQL_JOBS == '1' && needs.basic-checks.outputs.has-tests == 'true' }}
489505
runs-on: ubuntu-22.04
490506
strategy:
491507
matrix:
@@ -632,7 +648,8 @@ jobs:
632648

633649
# Test with IIS & PostgreSQL on Windows
634650
windows-tests:
635-
if: ${{ inputs.RUN_WINDOWS_JOBS == '1' }}
651+
needs: basic-checks
652+
if: ${{ inputs.RUN_WINDOWS_JOBS == '1' && needs.basic-checks.outputs.has-tests == 'true' }}
636653
runs-on: windows-latest
637654
strategy:
638655
matrix:

0 commit comments

Comments
 (0)