Skip to content

Commit 3a64fee

Browse files
committed
Change test strategy for commit tests
1 parent 0e88cdb commit 3a64fee

File tree

3 files changed

+24
-146
lines changed

3 files changed

+24
-146
lines changed

.github/pull_request_template.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
88
> If a modification is not involved, please skip it directly.
99
10-
- [ ] If you modified `*.php`, run `composer cs-fix` at local machine.
11-
- [ ] If it's an extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
12-
- [ ] If you changed the behavior of static-php-cli, update docs in `./docs/`.
13-
- [ ] If you updated `config/xxx.json` content, run `bin/spc dev:sort-config xxx`.
10+
- If you modified `*.php` or `*.json`, run them locally to ensure your changes are valid:
11+
- [ ] `PHP_CS_FIXER_IGNORE_ENV=1 composer cs-fix`
12+
- [ ] `composer analyse`
13+
- [ ] `composer test`
14+
- [ ] `bin/spc dev:sort-config`
15+
- If it's an extension or dependency update, please ensure the following:
16+
- [ ] Add your test combination to `src/globals/test-extensions.php`.
17+
- [ ] If adding new or fixing bugs, add commit message containing `fix` or `test` to trigger full test suite.

.github/workflows/commit-tests.yml

Lines changed: 0 additions & 137 deletions
This file was deleted.

.github/workflows/ext-matrix-tests.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
name: "Extension matrix tests"
22

3+
4+
# Only run if:
5+
# - the workflow is manually triggered
6+
# - or a pull request is made to the main branch that modifies this workflow file or commit message contains "fix" or "test"
37
on:
4-
workflow_dispatch:
5-
pull_request:
6-
branches: [ "main" ]
7-
paths:
8-
- '.github/workflows/ext-matrix-tests.yml'
8+
workflow_dispatch:
9+
pull_request:
10+
branches: [ "main" ]
11+
paths:
12+
- '.github/workflows/ext-matrix-tests.yml'
13+
- 'src/**'
14+
- 'config/**'
15+
- 'bin/**'
16+
- 'composer.json'
17+
- 'box.json'
18+
- '.php-cs-fixer.php'
919

1020
jobs:
1121
test:
1222
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
1323
runs-on: ${{ matrix.operating-system }}
24+
if: contains(github.event.head_commit.message, 'fix') || contains(github.event.head_commit.message, 'test')
1425
strategy:
1526
fail-fast: false
1627
matrix:

0 commit comments

Comments
 (0)