Skip to content

Commit add694c

Browse files
authored
Merge pull request #17 from Codeception/automated-release-drop-old-phpunit
feat!: drop old phpunit set up automated releases
2 parents 1444ccc + 3ea79a9 commit add694c

File tree

5 files changed

+83
-4
lines changed

5 files changed

+83
-4
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on: [pull_request]
44

55
jobs:
66
tests:
77
runs-on: ubuntu-latest
88

99
strategy:
1010
matrix:
11-
php: [8.1, 8.2, 8.3, 8.4]
11+
php: [8.2, 8.3, 8.4]
1212

1313
steps:
1414
- name: Checkout code

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Automated release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
php: [ 8.2, 8.3, 8.4 ]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
tools: phpcs, phpstan
23+
24+
- name: Validate composer.json
25+
run: composer validate
26+
27+
- name: Install dependencies
28+
run: composer install
29+
30+
- name: Code style
31+
run: phpcs src/ tests/
32+
33+
- name: Static analysis
34+
run: phpstan
35+
36+
- name: Run tests
37+
run: ./vendor/bin/phpunit tests/
38+
release:
39+
name: Automated release
40+
needs:
41+
- tests
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 0
47+
persist-credentials: false
48+
- uses: actions/setup-node@v4
49+
with:
50+
node-version: 22
51+
- run: >
52+
npx
53+
-p "@semantic-release/commit-analyzer"
54+
-p "@semantic-release/release-notes-generator"
55+
-p conventional-changelog-conventionalcommits
56+
-p semantic-release
57+
-- semantic-release
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
permissions:
61+
packages: write
62+
contents: write
63+
pull-requests: write

.releaserc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"branches": ["master"],
3+
"tagFormat": "${version}",
4+
"plugins": [
5+
["@semantic-release/commit-analyzer", {
6+
"preset": "conventionalcommits",
7+
"presetConfig": {}
8+
}],
9+
"@semantic-release/github",
10+
"@semantic-release/release-notes-generator"]
11+
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
],
1414
"homepage": "https://codeception.com/",
1515
"require": {
16-
"php": "^8.1",
16+
"php": "^8.2",
1717
"ext-mbstring": "*",
1818
"guzzlehttp/psr7": "^2.0",
19-
"phpunit/phpunit": "^9.5 | ^10.0 | ^11.0 | ^12",
19+
"phpunit/phpunit": "^11.5 | ^12",
2020
"symfony/css-selector": ">=4.4.24 <8.0"
2121
},
2222
"require-dev": {

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
paths:
3+
- ./src
4+
- ./tests
5+
level: 5

0 commit comments

Comments
 (0)