Skip to content

Commit d01bf33

Browse files
authored
Merge pull request #1798 from spatie/chore/ci-updates
Chore/ci updates
2 parents 77d5b17 + 58b4352 commit d01bf33

File tree

5 files changed

+115
-93
lines changed

5 files changed

+115
-93
lines changed

.github/dependabot.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
# Please see the documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
14
version: 2
25
updates:
3-
- package-ecosystem: "github-actions"
4-
directory: "/"
5-
schedule:
6-
interval: "monthly"
6+
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "monthly"
11+
labels:
12+
- "dependencies"
13+
14+
- package-ecosystem: "composer"
15+
directory: "/"
16+
schedule:
17+
interval: "monthly"
18+
labels:
19+
- "dependencies"

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

+24-31
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,32 @@ name: dependabot-auto-merge
22
on: pull_request_target
33

44
permissions:
5-
pull-requests: write
6-
contents: write
5+
pull-requests: write
6+
contents: write
77

88
jobs:
9-
dependabot:
10-
runs-on: ubuntu-latest
11-
if: ${{ github.actor == 'dependabot[bot]' }}
12-
steps:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
1314

14-
- name: Dependabot metadata
15-
id: metadata
16-
uses: dependabot/[email protected]
17-
with:
18-
github-token: "${{ secrets.GITHUB_TOKEN }}"
19-
compat-lookup: true
15+
- name: Dependabot metadata
16+
id: metadata
17+
uses: dependabot/[email protected]
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
2020

21-
- name: Auto-merge Dependabot PRs for semver-minor updates
22-
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
23-
run: gh pr merge --auto --merge "$PR_URL"
24-
env:
25-
PR_URL: ${{github.event.pull_request.html_url}}
26-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
21+
- name: Auto-merge Dependabot PRs for semver-minor updates
22+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
23+
run: gh pr merge --auto --merge "$PR_URL"
24+
env:
25+
PR_URL: ${{github.event.pull_request.html_url}}
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2727

28-
- name: Auto-merge Dependabot PRs for semver-patch updates
29-
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
30-
run: gh pr merge --auto --merge "$PR_URL"
31-
env:
32-
PR_URL: ${{github.event.pull_request.html_url}}
33-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
34-
35-
- name: Auto-merge Dependabot PRs for Action major versions when compatibility is higher than 90%
36-
if: ${{steps.metadata.outputs.package-ecosystem == 'github_actions' && steps.metadata.outputs.update-type == 'version-update:semver-major' && steps.metadata.outputs.compatibility-score >= 90}}
37-
run: gh pr merge --auto --merge "$PR_URL"
38-
env:
39-
PR_URL: ${{github.event.pull_request.html_url}}
40-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
28+
- name: Auto-merge Dependabot PRs for semver-patch updates
29+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
30+
run: gh pr merge --auto --merge "$PR_URL"
31+
env:
32+
PR_URL: ${{github.event.pull_request.html_url}}
33+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

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

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
name: Check & fix styling
22

3-
on: [push]
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
permissions:
9+
contents: write
410

511
jobs:
6-
style:
12+
php-code-styling:
713
runs-on: ubuntu-latest
14+
timeout-minutes: 5
815

916
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v4
12-
13-
- name: Fix style
14-
uses: docker://oskarstark/php-cs-fixer-ga
15-
with:
16-
args: --config=.php_cs.dist.php --allow-risky=yes
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.head_ref }}
1721

18-
- name: Extract branch name
19-
shell: bash
20-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
21-
id: extract_branch
22+
- name: Fix PHP code style issues
23+
uses: aglipanci/[email protected]
2224

23-
- name: Commit changes
24-
uses: stefanzweifel/[email protected]
25-
with:
26-
commit_message: Fix styling
27-
branch: ${{ steps.extract_branch.outputs.branch }}
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Commit changes
26+
uses: stefanzweifel/git-auto-commit-action@v5
27+
with:
28+
commit_message: Fix styling

.github/workflows/phpstan.yml

+2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ on:
55
paths:
66
- '**.php'
77
- 'phpstan.neon.dist'
8+
- '.github/workflows/phpstan.yml'
89

910
jobs:
1011
phpstan:
1112
name: phpstan
1213
runs-on: ubuntu-latest
14+
timeout-minutes: 5
1315
steps:
1416
- uses: actions/checkout@v4
1517

.github/workflows/run-tests.yml

+53-38
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,68 @@
11
name: run-tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- '.github/workflows/run-tests.yml'
8+
- 'phpunit.xml.dist'
9+
- 'composer.json'
10+
- 'composer.lock'
411

512
jobs:
6-
tests:
13+
test:
714
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 5
816
strategy:
917
fail-fast: false
1018
matrix:
1119
os: [ubuntu-latest]
1220
php: [8.3, 8.2, 8.1]
13-
laravel: [10.*, 11.*]
14-
dependency-version: [prefer-stable]
21+
laravel: [11.*, 10.*]
22+
stability: [prefer-lowest, prefer-stable]
23+
carbon: [^2.63]
1524
include:
16-
- laravel: 10.*
17-
testbench: 8.*
18-
- laravel: 11.*
19-
testbench: 9.*
25+
- laravel: 10.*
26+
testbench: 8.*
27+
- laravel: 11.*
28+
testbench: 9.*
2029
exclude:
21-
- laravel: 11.*
22-
php: 8.1
30+
- laravel: 11.*
31+
php: 8.1
2332

24-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
33+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2534

2635
steps:
27-
- name: Checkout code
28-
uses: actions/checkout@v4
29-
30-
- name: Install SQLite 3
31-
run: |
32-
sudo apt-get update
33-
sudo apt-get install sqlite3
34-
35-
- name: Setup PHP
36-
uses: shivammathur/setup-php@v2
37-
with:
38-
php-version: ${{ matrix.php }}
39-
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
40-
coverage: none
41-
42-
- name: Install dependencies
43-
run: |
44-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:>=2.62.1" --no-interaction --no-update
45-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
46-
47-
- name: Setup Problem Matches
48-
run: |
49-
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
50-
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
51-
52-
- name: Execute tests
53-
run: vendor/bin/pest
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Install SQLite 3
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install sqlite3
43+
44+
- name: Setup PHP
45+
uses: shivammathur/setup-php@v2
46+
with:
47+
php-version: ${{ matrix.php }}
48+
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
49+
coverage: none
50+
51+
- name: Setup problem matchers
52+
run: |
53+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
54+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
55+
56+
- name: Install dependencies
57+
run: |
58+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.os == 'windows-latest' && '^^^' || '' }}${{ matrix.carbon }}" --no-interaction --no-update
59+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
60+
61+
- name: List Installed Dependencies
62+
run: composer show -D
63+
64+
- name: Execute tests
65+
run: vendor/bin/pest --ci
66+
67+
68+

0 commit comments

Comments
 (0)