Skip to content

Commit ad317f5

Browse files
committed
ci: Update Github actions configuration.
1 parent 7b51ebb commit ad317f5

File tree

4 files changed

+116
-12
lines changed

4 files changed

+116
-12
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: composer
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10

.github/workflows/continuous-integration.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,62 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
17-
php-versions: ['7.1', '7.2', '7.3', '7.4']
17+
php-versions: ['7.4']
1818

1919
steps:
20+
- name: Set git to use LF
21+
run: |
22+
git config --global core.autocrlf false
23+
git config --global core.eol lf
24+
2025
- name: Checkout
21-
uses: actions/checkout@master
26+
uses: actions/checkout@v2.3.4
2227
with:
2328
fetch-depth: 1
2429

25-
- name: Install browser
26-
if: matrix.operating-system == 'ubuntu-latest'
27-
run: sudo apt-get install w3m
28-
2930
- name: Install PHP
30-
uses: shivammathur/setup-php@master
31+
uses: shivammathur/setup-php@v2
3132
with:
3233
php-version: ${{ matrix.php-versions }}
33-
extensions: mbstring,xdebug
34+
extensions: mbstring,pcov,xdebug
3435

3536
- name: Get Composer Cache Directory
3637
id: composer-cache
3738
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
3839

3940
- name: Cache dependencies
40-
uses: actions/cache@v1
41+
uses: actions/cache@v2
4142
with:
4243
path: ${{ steps.composer-cache.outputs.dir }}
4344
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
4445
restore-keys: ${{ runner.os }}-composer-
4546

4647
- name: Install dependencies
47-
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
48+
run: composer install --no-progress --prefer-dist --optimize-autoloader
4849

4950
- name: Run Grumphp
50-
run: vendor/bin/grumphp run
51+
run: vendor/bin/grumphp run --no-ansi -n
52+
env:
53+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
5154

5255
- name: Send PSALM data
5356
run: vendor/bin/psalm --shepherd --stats
5457
continue-on-error: true
5558

56-
- name: Scrutinizer
59+
- name: Send Scrutinizer data
5760
run: |
5861
wget https://scrutinizer-ci.com/ocular.phar
5962
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
6063
continue-on-error: true
64+
65+
- name: Infection score report
66+
run: |
67+
vendor/bin/infection run -j 2
68+
continue-on-error: true
69+
70+
- name: PHP Insights report
71+
run: |
72+
rm -rf composer.lock vendor
73+
composer require nunomaduro/phpinsights --dev
74+
vendor/bin/phpinsights analyse src/ -n
75+
continue-on-error: true

.github/workflows/prune.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# https://docs.github.com/en/actions
2+
3+
name: "Prune"
4+
5+
on: # yamllint disable-line rule:truthy
6+
schedule:
7+
- cron: "0 12 * * *"
8+
9+
env:
10+
DAYS_BEFORE_CLOSE: 5
11+
DAYS_BEFORE_STALE: 5
12+
13+
jobs:
14+
prune:
15+
name: "Issues"
16+
17+
runs-on: "ubuntu-latest"
18+
19+
steps:
20+
- name: "Prune issues and pull requests"
21+
uses: "actions/stale@v3.0.12"
22+
with:
23+
days-before-close: "${{ env.DAYS_BEFORE_CLOSE }}"
24+
days-before-stale: "${{ env.DAYS_BEFORE_STALE }}"
25+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
26+
stale-issue-label: "stale"
27+
stale-issue-message: |
28+
Since this issue has not had any activity within the last ${{ env.DAYS_BEFORE_STALE }} days, I have marked it as stale.
29+
I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_CLOSE }} days.
30+
stale-pr-label: "stale"
31+
stale-pr-message: |
32+
Since this pull request has not had any activity within the last ${{ env.DAYS_BEFORE_STALE }} days, I have marked it as stale.
33+
I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_CLOSE }} days.

.github/workflows/release.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# https://docs.github.com/en/actions
2+
3+
name: "Release"
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
tags:
8+
- "**"
9+
10+
jobs:
11+
release:
12+
name: "Release"
13+
14+
runs-on: "ubuntu-latest"
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2.3.3
19+
with:
20+
fetch-depth: 1
21+
22+
- name: Determine tag
23+
id: tag_name
24+
run: |
25+
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
26+
shell: bash
27+
28+
- name: Get Changelog Entry
29+
id: changelog_reader
30+
uses: mindsers/changelog-reader-action@v2
31+
with:
32+
version: ${{ steps.tag_name.outputs.current_version }}
33+
path: ./CHANGELOG.md
34+
35+
- name: "Create release"
36+
uses: "actions/create-release@v1.1.4"
37+
env:
38+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
39+
with:
40+
release_name: "${{ steps.tag_name.outputs.current_version }}"
41+
tag_name: "${{ steps.tag_name.outputs.current_version }}"
42+
body: ${{ steps.changelog_reader.outputs.changes }}
43+
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
44+
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}

0 commit comments

Comments
 (0)