Skip to content

Commit 3df707a

Browse files
authored
[1.x] Improve workflows (#190)
* chore: remove unnecessary files * chore: update ci workflow * fix: add missing commands * chore: update pr template * fix: add missing extensions
1 parent 8bdbe65 commit 3df707a

File tree

6 files changed

+28
-293
lines changed

6 files changed

+28
-293
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
| Q | A |
2-
|---------------|--------------------------------------------------------------------------|
3-
| Branch? | master for breaking changes, and `release/y.x` for bc <!-- see below --> |
4-
| Bug fix? | yes/no |
5-
| New feature? | yes/no <!-- please update /CHANGELOG.md files --> |
6-
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and /CHANGELOG.md files --> |
7-
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", --> |
8-
| License | MIT |
1+
| Q | A |
2+
|---------------|----------------------------------------------------------|
3+
| Branch? | 1.x (current) or main (for breaking changes) |
4+
| Deprecations? | yes/no <!-- please update UPGRADE-2.md |
5+
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", --> |
6+
| License | MIT |
97

108
<!--
119
Replace this notice with a short README for your feature/bugfix.
1210
This will help reviewers and should be a good start for the documentation.
1311
1412
For bug fixes and new features, that does not break BC, please base your PR
1513
on the `release/y.x` branch. For BC breaks, please base your PR on the
16-
`master` branch.
14+
`main` branch.
1715
1816
Always add tests and ensure they pass.
1917
-->

.github/workflows/ci.yml

Lines changed: 18 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,36 @@
1-
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2-
3-
name: "Continuous Integration"
4-
5-
on:
6-
pull_request:
7-
push:
8-
1+
name: CI
2+
on: [ push, pull_request ]
93
jobs:
10-
phpunit:
11-
name: "PHPUnit tests"
12-
4+
ci:
5+
name: "CI"
136
runs-on: ${{ matrix.operating-system }}
14-
157
strategy:
168
matrix:
17-
dependencies:
18-
- "locked"
19-
php-version:
20-
- "8.0"
21-
- "8.1"
22-
- "8.2"
23-
operating-system:
24-
- "ubuntu-latest"
25-
- "windows-latest"
26-
- "macos-latest"
27-
9+
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
10+
php-version: [ 8.0, 8.3 ]
2811
steps:
12+
13+
# --------- Setup steps ---------
2914
- name: "Checkout"
30-
uses: "actions/checkout@v3"
15+
uses: actions/checkout@v3
3116

32-
- name: "Install PHP"
33-
uses: "shivammathur/setup-php@v2"
17+
- name: "Setup PHP"
18+
uses: shivammathur/setup-php@v2
3419
with:
3520
coverage: "pcov"
3621
php-version: "${{ matrix.php-version }}"
3722
ini-values: memory_limit=-1
38-
extensions: sodium, fileinfo
23+
extensions: pcov, xdebug, sodium, fileinfo
3924

4025
- name: "Install dependencies"
41-
uses: "ramsey/composer-install@v2"
42-
with:
43-
dependency-versions: "${{ matrix.dependencies }}"
26+
uses: ramsey/composer-install@v2
4427

45-
- name: "Tests"
28+
# --------- Run steps ---------
29+
- name: "Unit Tests"
4630
run: "composer test"
4731

48-
static-analysis-psalm:
49-
name: "Static Analysis by Psalm"
50-
51-
runs-on: ${{ matrix.operating-system }}
52-
53-
strategy:
54-
matrix:
55-
dependencies:
56-
- "locked"
57-
php-version:
58-
- "8.0"
59-
operating-system:
60-
- "ubuntu-latest"
61-
62-
steps:
63-
- name: "Checkout"
64-
uses: "actions/checkout@v3"
65-
66-
- name: "Install PHP"
67-
uses: "shivammathur/setup-php@v2"
68-
with:
69-
coverage: "none"
70-
php-version: "${{ matrix.php-version }}"
71-
ini-values: memory_limit=-1
72-
extensions: sodium, fileinfo
73-
74-
- name: "Install dependencies"
75-
uses: "ramsey/composer-install@v2"
76-
with:
77-
dependency-versions: "${{ matrix.dependencies }}"
32+
- name: "Coding Style"
33+
run: "composer cs-fix"
7834

79-
- name: "psalm"
35+
- name: "Static code analysis"
8036
run: "composer psalm"
81-
82-
coding-standards:
83-
name: "Check Coding Standards"
84-
85-
runs-on: ${{ matrix.operating-system }}
86-
87-
strategy:
88-
matrix:
89-
dependencies:
90-
- "locked"
91-
php-version:
92-
- "8.0"
93-
operating-system:
94-
- "ubuntu-latest"
95-
96-
steps:
97-
- name: "Checkout"
98-
uses: "actions/checkout@v3"
99-
100-
- name: "Install PHP"
101-
uses: "shivammathur/setup-php@v2"
102-
with:
103-
coverage: "none"
104-
php-version: "${{ matrix.php-version }}"
105-
ini-values: memory_limit=-1
106-
extensions: sodium, fileinfo
107-
108-
- name: "Install dependencies"
109-
uses: "ramsey/composer-install@v2"
110-
with:
111-
dependency-versions: "${{ matrix.dependencies }}"
112-
113-
- name: "Coding Standard"
114-
run: "composer check-style"

.github/workflows/close-stales.yml

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

.github/workflows/update-changelog.yml

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

CHANGELOG.md

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

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
}
3636
},
3737
"scripts": {
38-
"psalm": "vendor/bin/psalm",
3938
"psalm-info": "vendor/bin/psalm --show-info=true",
40-
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
41-
"check-style": "vendor/bin/php-cs-fixer fix --dry-run",
4239
"test": "vendor/bin/phpunit --testdox",
4340
"keygen": "sh ./bin/keygen.sh",
4441
"security-advice": "composer update --dry-run roave/security-advisories",
42+
"cs-check": "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose",
43+
"cs-fix": "php-cs-fixer fix --verbose",
44+
"psalm": "psalm --no-cache",
4545
"post-autoload-dump": [
4646
"@keygen"
4747
]

0 commit comments

Comments
 (0)