Skip to content

Commit 4cb46f2

Browse files
authored
Merge pull request #29 from Roave/add-release-automation
Add release automation
2 parents 1245a13 + 053e3ef commit 4cb46f2

File tree

9 files changed

+4102
-58
lines changed

9 files changed

+4102
-58
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "Mutation tests"
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
mutation-tests:
9+
name: "Mutation tests"
10+
11+
runs-on: ${{ matrix.operating-system }}
12+
13+
strategy:
14+
matrix:
15+
dependencies:
16+
- "locked"
17+
php-version:
18+
- "8.0"
19+
operating-system:
20+
- "ubuntu-latest"
21+
22+
steps:
23+
- name: "Checkout"
24+
uses: "actions/checkout@v2"
25+
with:
26+
fetch-depth: 0
27+
28+
- name: "Install PHP"
29+
uses: "shivammathur/setup-php@v2"
30+
with:
31+
coverage: "pcov"
32+
php-version: "${{ matrix.php-version }}"
33+
ini-values: memory_limit=-1
34+
tools: composer:v2, cs2pr
35+
36+
- name: "Cache dependencies"
37+
uses: "actions/cache@v2"
38+
with:
39+
path: |
40+
~/.composer/cache
41+
vendor
42+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
43+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
44+
45+
- name: "Install lowest dependencies"
46+
if: ${{ matrix.dependencies == 'lowest' }}
47+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
48+
49+
- name: "Install highest dependencies"
50+
if: ${{ matrix.dependencies == 'highest' }}
51+
run: "composer update --no-interaction --no-progress --no-suggest"
52+
53+
- name: "Install locked dependencies"
54+
if: ${{ matrix.dependencies == 'locked' }}
55+
run: "composer install --no-interaction --no-progress --no-suggest"
56+
57+
- name: "Infection"
58+
run: "vendor/bin/infection --min-msi=100 --min-covered-msi=100"
59+
env:
60+
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
61+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
62+

.github/workflows/phpunit.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "PHPUnit tests"
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
phpunit:
9+
name: "PHPUnit tests"
10+
11+
runs-on: ${{ matrix.operating-system }}
12+
13+
strategy:
14+
matrix:
15+
dependencies:
16+
- "lowest"
17+
- "highest"
18+
- "locked"
19+
php-version:
20+
- "8.0"
21+
operating-system:
22+
- "ubuntu-latest"
23+
24+
steps:
25+
- name: "Checkout"
26+
uses: "actions/checkout@v2"
27+
with:
28+
fetch-depth: 0
29+
30+
- name: "Install PHP"
31+
uses: "shivammathur/setup-php@v2"
32+
with:
33+
coverage: "pcov"
34+
php-version: "${{ matrix.php-version }}"
35+
ini-values: memory_limit=-1
36+
tools: composer:v2, cs2pr
37+
38+
- name: "Cache dependencies"
39+
uses: "actions/cache@v2"
40+
with:
41+
path: |
42+
~/.composer/cache
43+
vendor
44+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
46+
47+
- name: "Install lowest dependencies"
48+
if: ${{ matrix.dependencies == 'lowest' }}
49+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
50+
51+
- name: "Install highest dependencies"
52+
if: ${{ matrix.dependencies == 'highest' }}
53+
run: "composer update --no-interaction --no-progress --no-suggest"
54+
55+
- name: "Install locked dependencies"
56+
if: ${{ matrix.dependencies == 'locked' }}
57+
run: "composer install --no-interaction --no-progress --no-suggest"
58+
59+
- name: "Tests"
60+
run: "vendor/bin/phpunit"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Alternate workflow example.
2+
# This one is identical to the one in release-on-milestone.yml, with one change:
3+
# the Release step uses the ORGANIZATION_ADMIN_TOKEN instead, to allow it to
4+
# trigger a release workflow event. This is useful if you have other actions
5+
# that intercept that event.
6+
7+
name: "Automatic Releases"
8+
9+
on:
10+
milestone:
11+
types:
12+
- "closed"
13+
14+
jobs:
15+
release:
16+
name: "GIT tag, release & create merge-up PR"
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: "Checkout"
21+
uses: "actions/checkout@v2"
22+
23+
- name: "Release"
24+
uses: "laminas/automatic-releases@v1"
25+
with:
26+
command-name: "laminas:automatic-releases:release"
27+
env:
28+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
29+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
30+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
31+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
32+
33+
- name: "Create Merge-Up Pull Request"
34+
uses: "laminas/automatic-releases@v1"
35+
with:
36+
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
37+
env:
38+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
39+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
40+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
41+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
42+
43+
- name: "Create and/or Switch to new Release Branch"
44+
uses: "laminas/automatic-releases@v1"
45+
with:
46+
command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor"
47+
env:
48+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
49+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
50+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
51+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
52+
53+
- name: "Bump Changelog Version On Originating Release Branch"
54+
uses: "laminas/automatic-releases@v1"
55+
with:
56+
command-name: "laminas:automatic-releases:bump-changelog"
57+
env:
58+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
59+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
60+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
61+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
62+
63+
- name: "Create new milestones"
64+
uses: "laminas/automatic-releases@v1"
65+
with:
66+
command-name: "laminas:automatic-releases:create-milestones"
67+
env:
68+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
69+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
70+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
71+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
vendor
2-
composer.lock
32
composer.phar
43
phpunit.xml
54
phpmd.xml

.scrutinizer.yml

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

.travis.yml

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

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
practices when it comes to designing
55
[defensive code](https://ocramius.github.io/extremely-defensive-php/).
66

7-
[![Build Status](https://travis-ci.org/Roave/Dont.svg)](https://travis-ci.org/Roave/Dont)
8-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Roave/Dont/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Roave/Dont/?branch=master)
9-
[![Code Coverage](https://scrutinizer-ci.com/g/Roave/Dont/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Roave/Dont/?branch=master)
7+
[![Infection MSI](https://badge.stryker-mutator.io/github.com/Roave/Dont/1.2.x)](https://infection.github.io)
108
[![Packagist](https://img.shields.io/packagist/v/roave/dont.svg)](https://packagist.org/packages/roave/dont)
119
[![Packagist](https://img.shields.io/packagist/vpre/roave/dont.svg)](https://packagist.org/packages/roave/dont)
1210

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.0"
19+
"php": "8.0.*"
2020
},
2121
"require-dev": {
2222
"phpunit/phpunit": "^9.3",

0 commit comments

Comments
 (0)