Skip to content

Commit 9d05209

Browse files
committed
feat(ci): enable php integration tests on nightly run
Signed-off-by: Ashim Shrestha <ashimshrestha2384@gmail.com>
1 parent 26996fc commit 9d05209

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,24 @@ on:
88
- 'v*'
99
pull_request:
1010
workflow_dispatch:
11+
inputs:
12+
simulate_nightly:
13+
description: 'Simulate nightly run (skip checks/unit-tests/docs/sonar)'
14+
required: false
15+
type: boolean
16+
default: false
1117
schedule:
1218
- cron: "0 0 * * *" # Every day at midnight
1319

1420
env:
1521
COMPOSER_HOME: ${{ github.workspace }}/.cache/composer
1622
DEFAULT_PHP_VERSION: '8.1'
23+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1724

1825
jobs:
1926
php-checks:
2027
name: php checks
21-
if: github.event_name != 'schedule'
28+
if: github.event_name != 'schedule' && (github.event_name != 'workflow_dispatch' || !inputs.simulate_nightly)
2229
runs-on: ubuntu-latest
2330

2431
steps:
@@ -47,7 +54,7 @@ jobs:
4754

4855
php-unit-tests:
4956
name: php unit tests (${{ matrix.php-version }}-with-coverage)
50-
if: github.event_name != 'schedule'
57+
if: github.event_name != 'schedule' && (github.event_name != 'workflow_dispatch' || !inputs.simulate_nightly)
5158
runs-on: ubuntu-latest
5259
needs: php-checks
5360
strategy:
@@ -87,7 +94,7 @@ jobs:
8794
name: buildOcis
8895
runs-on: ubuntu-latest
8996
needs: php-checks
90-
if: always() && (success() || github.event_name == 'schedule')
97+
if: always() && (success() || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.simulate_nightly))
9198
strategy:
9299
fail-fast: false
93100
matrix:
@@ -187,6 +194,7 @@ jobs:
187194
name: php integration tests (${{ matrix.php-version}}-${{ matrix.branch }}${{ matrix.branch == 'master' && matrix.php-version == '8.1' && '-with-coverage' || '' }})
188195
runs-on: ubuntu-latest
189196
needs: build-ocis
197+
if: always() && (success() || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.simulate_nightly))
190198
strategy:
191199
fail-fast: false
192200
matrix:
@@ -288,7 +296,7 @@ jobs:
288296

289297
docs:
290298
name: docs
291-
if: github.event_name != 'schedule'
299+
if: github.event_name != 'schedule' && (github.event_name != 'workflow_dispatch' || !inputs.simulate_nightly)
292300
runs-on: ubuntu-latest
293301
needs: [php-unit-tests, php-integration-tests]
294302
steps:
@@ -322,7 +330,7 @@ jobs:
322330

323331
sonar-analysis:
324332
name: sonar analysis
325-
if: github.event_name != 'schedule'
333+
if: github.event_name != 'schedule' && (github.event_name != 'workflow_dispatch' || !inputs.simulate_nightly)
326334
runs-on: ubuntu-latest
327335
needs: [php-unit-tests, php-integration-tests]
328336
steps:

0 commit comments

Comments
 (0)