Skip to content

Commit 9d0ead9

Browse files
authored
Tweaks for Workflow Caching, Wait
1 parent 9916773 commit 9d0ead9

File tree

5 files changed

+125
-7
lines changed

5 files changed

+125
-7
lines changed

.github/workflows/pint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Fix PHP code style issues
2727
uses: aglipanci/laravel-pint-action@latest
2828

29-
- name: Commit changes
29+
- name: Commit styling changes
3030
uses: stefanzweifel/git-auto-commit-action@v5
3131
with:
3232
commit_message: Fix styling
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: run-phpstan-pull
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- 'master'
7+
- 'development'
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
os: [ubuntu-latest]
16+
php: [8.3]
17+
laravel: [11]
18+
stability: [prefer-dist]
19+
20+
name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
21+
env:
22+
extensionKey: phpextensions
23+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup cache environment
30+
id: extcache
31+
uses: shivammathur/cache-extensions@v1
32+
with:
33+
php-version: ${{ matrix.php }}
34+
extensions: ${{ env.extensions }}
35+
key: ${{ env.extensionKey }}
36+
37+
- name: Cache extensions
38+
uses: actions/cache@v4
39+
with:
40+
path: ${{ steps.extcache.outputs.dir }}
41+
key: ${{ steps.extcache.outputs.key }}
42+
restore-keys: ${{ steps.extcache.outputs.key }}
43+
44+
- name: Setup PHP
45+
uses: shivammathur/setup-php@v2
46+
with:
47+
php-version: ${{ matrix.php }}
48+
extensions: ${{ env.extensions }}
49+
coverage: pcov
50+
tools: phpunit:9.5
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
54+
- name: Setup problem matchers for PHP
55+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
56+
57+
- name: Get composer cache directory
58+
id: composer-cache
59+
run: |
60+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
61+
62+
- uses: actions/cache@v4
63+
with:
64+
path: ${{ steps.composer-cache.outputs.dir }}
65+
key: ${{ runner.os }}-PHPStan-P${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
66+
restore-keys: ${{ runner.os }}-PHPStan-P${{ matrix.php }}-L${{ matrix.laravel }}-composer-
67+
68+
- name: Add token
69+
run: |
70+
composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
71+
72+
- name: Install dependencies
73+
if: steps.composer-cache.outputs.cache-hit != 'true'
74+
run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update
75+
76+
- name: Update dependencies
77+
if: steps.composer-cache.outputs.cache-hit != 'true'
78+
run: composer update --${{ matrix.stability }} --no-interaction
79+
80+
- name: Install PHPStan
81+
run: composer require larastan/larastan:^2.0 --dev --no-interaction
82+
83+
- name: Cache Larastan result cache
84+
uses: actions/cache@v4
85+
with:
86+
path: .phpstan.cache
87+
key: ${{ github.run_id }}-phpstan-result-cache
88+
restore-keys: phpstan-result-cache-
89+
90+
- name: Run PHPStan Tests
91+
run: ./vendor/bin/phpstan analyse

.github/workflows/run-phpstan.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: run-phpstan
22

33
on:
4-
pull_request:
5-
branches:
6-
- 'master'
7-
- 'development'
84
push:
95
branches:
106
- '*' # matches every branch that doesn't contain a '/'
@@ -26,10 +22,18 @@ jobs:
2622

2723
name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2824
env:
29-
extensionKey: phpextensions
25+
extensionKey: phpstan-phpextensions
3026
extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
3127

3228
steps:
29+
- name: Wait for styling to finish
30+
uses: lewagon/[email protected]
31+
with:
32+
ref: ${{ github.ref }}
33+
running-workflow-name: 'Fix PHP code style issues'
34+
repo-token: ${{ secrets.GITHUB_TOKEN }}
35+
wait-interval: 20
36+
3337
- name: Checkout code
3438
uses: actions/checkout@v4
3539

@@ -87,5 +91,12 @@ jobs:
8791
- name: Install PHPStan
8892
run: composer require larastan/larastan:^2.0 --dev --no-interaction
8993

94+
- name: Cache Larastan result cache
95+
uses: actions/cache@v4
96+
with:
97+
path: .phpstan.cache
98+
key: ${{ github.run_id }}-phpstan-result-cache
99+
restore-keys: phpstan-result-cache-
100+
90101
- name: Run PHPStan Tests
91102
run: ./vendor/bin/phpstan analyse

.github/workflows/run-tests.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ jobs:
2626
extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr
2727

2828
steps:
29+
- name: Wait for styling to finish
30+
uses: lewagon/[email protected]
31+
with:
32+
ref: ${{ github.ref }}
33+
running-workflow-name: 'Fix PHP code style issues'
34+
repo-token: ${{ secrets.GITHUB_TOKEN }}
35+
wait-interval: 20
36+
2937
- name: Checkout code
3038
uses: actions/checkout@v4
3139

@@ -105,6 +113,14 @@ jobs:
105113
extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr
106114

107115
steps:
116+
- name: Wait for styling to finish
117+
uses: lewagon/[email protected]
118+
with:
119+
ref: ${{ github.ref }}
120+
running-workflow-name: 'Fix PHP code style issues'
121+
repo-token: ${{ secrets.GITHUB_TOKEN }}
122+
wait-interval: 20
123+
108124
- name: Checkout code
109125
uses: actions/checkout@v4
110126

src/LaravelLivewireTablesServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function boot(): void
2424
__DIR__.'/../config/livewire-tables.php', 'livewire-tables'
2525
);
2626

27-
// Load Default Translations
27+
// Load Default Translations
2828
$this->loadJsonTranslationsFrom(
2929
__DIR__.'/../resources/lang'
3030
);

0 commit comments

Comments
 (0)