Skip to content

Commit 67197cb

Browse files
author
ityaozm@gmail.com
committed
ci(workflows): Add workflow_dispatch event for manual trigger
- Enable manual triggering of workflows by adding workflow_dispatch event. - Updates made to the following workflow files: - dependabot-auto-merge.yml - label.yml - lint-md.yml - php-cs-fixer.yml - rector.yml - stale.yml - update-changelog.yml - This enhancement allows developers to run workflows on demand, improving flexibility and control over CI/CD processes.
1 parent 3214974 commit 67197cb

8 files changed

Lines changed: 48 additions & 25 deletions

File tree

.github/workflows/dependabot-auto-merge.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: dependabot-auto-merge
22

3-
on: pull_request_target
3+
on:
4+
workflow_dispatch:
5+
pull_request_target:
46

57
permissions:
68
pull-requests: write

.github/workflows/label.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
name: labeler
99

10-
on: [ pull_request ]
10+
on:
11+
workflow_dispatch:
12+
pull_request:
1113

1214
jobs:
1315
label:

.github/workflows/lint-md.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: lint markdown
22

3-
on: [ push, pull_request ]
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
47

58
jobs:
69
lint-markdown:
@@ -9,9 +12,11 @@ jobs:
912
- name: Checkout
1013
uses: actions/checkout@v4
1114

12-
- name: lint-md-github-action
13-
uses: lint-md/github-action@v0.1.1
14-
with:
15-
configFile: .lintmdrc
16-
failOnWarnings: false
17-
files: ./ ./.github/ ./resources/docs/
15+
- name: Set node version
16+
uses: actions/setup-node@v4
17+
18+
- name: Install lint-md
19+
run: npm install -g @lint-md/cli
20+
21+
- name: Lint markdown
22+
run: lint-md --config .lintmdrc ./*.md ./.github/ ./resources/docs/

.github/workflows/php-cs-fixer.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: check & fix styling
22

3-
on: [ push ]
3+
on:
4+
workflow_dispatch:
5+
push:
46

57
jobs:
68
php-cs-fixer:
@@ -15,6 +17,8 @@ jobs:
1517
php-version: '8.2'
1618
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
1719
coverage: none
20+
env:
21+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1822

1923
- name: Cache composer dependencies
2024
uses: actions/cache@v4
@@ -23,13 +27,13 @@ jobs:
2327
key: composer-${{ hashFiles('composer.lock') }}
2428

2529
- name: Run composer install
26-
run: composer install --prefer-dist --ansi --no-interaction --ansi -v
30+
run: composer install --no-interaction --prefer-dist --ansi -v
2731

28-
# - name: Install global php-cs-fixer
29-
# run: composer global require friendsofphp/php-cs-fixer --prefer-dist --ansi --no-interaction --no-scripts
32+
- name: Run composer install for friendsofphp/php-cs-fixer
33+
run: composer bin php-cs-fixer-config require friendsofphp/php-cs-fixer --dev --ansi -v
3034

3135
- name: Run php-cs-fixer
32-
run: composer style-fix
36+
run: composer style-lint
3337

3438
- name: Commit changes
3539
uses: stefanzweifel/git-auto-commit-action@v5

.github/workflows/rector.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: rector
22

33
on:
4+
workflow_dispatch:
45
push:
56
paths:
67
- '**.php'
@@ -22,6 +23,8 @@ jobs:
2223
php-version: '8.2'
2324
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
2425
coverage: none
26+
env:
27+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2528

2629
- name: Cache composer dependencies
2730
uses: actions/cache@v4
@@ -30,10 +33,7 @@ jobs:
3033
key: composer-${{ hashFiles('composer.lock') }}
3134

3235
- name: Run composer install
33-
run: composer install --prefer-dist --ansi --no-interaction --ansi -v
34-
35-
# - name: Install global rector
36-
# run: composer global require rector/rector --prefer-dist --ansi --no-interaction --no-scripts
36+
run: composer install --no-interaction --prefer-dist --ansi -v
3737

3838
- name: Run rector
3939
run: composer rector-dry-run

.github/workflows/stale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
name: Mark stale issues and pull requests
77

88
on:
9+
workflow_dispatch:
910
schedule:
1011
- cron: '30 08 * * *'
1112

.github/workflows/tests.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: tests
22

3-
on: [ push, pull_request ]
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
8+
permissions: write-all
49

510
jobs:
611
test:
712
runs-on: ${{ matrix.os }}
13+
814
strategy:
9-
fail-fast: true
15+
fail-fast: false
1016
matrix:
1117
os: [ ubuntu-latest, windows-latest ]
1218
php: [ 8.2, 8.4 ]
@@ -30,17 +36,19 @@ jobs:
3036
php-version: ${{ matrix.php }}
3137
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
3238
coverage: xdebug
39+
env:
40+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3341

3442
- name: Install dependencies
3543
run: composer update --${{ matrix.dependency-version }} --prefer-dist --ansi --no-interaction --no-scripts
3644

3745
- name: Execute tests
38-
run: composer test-c
46+
run: composer test-coverage
3947

4048
- name: Upload coverage to Codecov
4149
uses: codecov/codecov-action@v5
4250
with:
43-
files: ./clover.xml
44-
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
45-
fail_ci_if_error: true # optional (default = false)
46-
verbose: true # optional (default = false)
51+
files: ./.build/phpunit/clover.xml
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
fail_ci_if_error: true
54+
verbose: true

.github/workflows/update-changelog.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: "update changelog"
22

33
on:
4+
workflow_dispatch:
45
release:
56
types: [ released ]
67

0 commit comments

Comments
 (0)