Skip to content

Commit 6ca4737

Browse files
committed
Action caching
1 parent ee51dd9 commit 6ca4737

4 files changed

Lines changed: 55 additions & 19 deletions

File tree

.github/workflows/docs-screenshots.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,41 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
steps:
13-
- uses: actions/checkout@v2
14-
- name: Cache dependencies
15-
uses: actions/cache@v2
13+
- uses: actions/checkout@v4
14+
- name: Cache Composer dependencies
15+
uses: actions/cache@v4
1616
with:
1717
path: ~/.composer/cache/files
18-
key: dependencies-composer-${{ hashFiles('composer.json') }}
18+
key: composer-screenshots-${{ hashFiles('docs-assets/app/composer.json') }}
19+
restore-keys: |
20+
composer-screenshots-
1921
- name: Set up PHP
2022
uses: shivammathur/setup-php@v2
2123
with:
2224
php-version: 8.5
2325
extensions: mbstring, pdo, pdo_sqlite
2426
coverage: none
2527
- name: Set up Node
26-
uses: actions/setup-node@v2
27-
- name: Install dependencies
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: lts/*
31+
- name: Cache Puppeteer browser
32+
id: puppeteer-cache
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.cache/puppeteer
36+
key: puppeteer-${{ runner.os }}-${{ hashFiles('docs-assets/screenshots/package-lock.json') }}
37+
- name: Install screenshot dependencies
2838
run: |
2939
cd docs-assets/screenshots
3040
npm ci
41+
env:
42+
PUPPETEER_SKIP_DOWNLOAD: ${{ steps.puppeteer-cache.outputs.cache-hit }}
43+
- name: Cache app npm dependencies
44+
uses: actions/cache@v4
45+
with:
46+
path: docs-assets/app/node_modules
47+
key: npm-screenshots-app-${{ hashFiles('docs-assets/app/package-lock.json') }}
3148
- name: Set up app
3249
run: |
3350
cd docs-assets/app

.github/workflows/fix-code-style.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,25 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout code
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
with:
1313
ref: ${{ github.head_ref }}
14+
- name: Cache Composer dependencies
15+
uses: actions/cache@v4
16+
with:
17+
path: ~/.composer/cache/files
18+
key: composer-cs-${{ hashFiles('composer.json') }}
19+
restore-keys: |
20+
composer-cs-
1421
- name: Set up PHP
1522
uses: shivammathur/setup-php@v2
1623
with:
1724
php-version: 8.5
1825
- name: Set up Node
19-
uses: actions/setup-node@v2
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: lts/*
29+
cache: npm
2030
- name: Install dependencies
2131
run: |
2232
composer install --no-interaction

.github/workflows/phpstan.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,22 @@ jobs:
3636
pest-plugin-laravel: ^3.0
3737
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
3838
steps:
39-
- uses: actions/checkout@v3
40-
- name: Cache dependencies
41-
uses: actions/cache@v3
39+
- uses: actions/checkout@v4
40+
- name: Cache Composer dependencies
41+
uses: actions/cache@v4
4242
with:
4343
path: ~/.composer/cache/files
44-
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
44+
key: composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('composer.json') }}
45+
restore-keys: |
46+
composer-${{ matrix.php }}-${{ matrix.laravel }}-
47+
composer-${{ matrix.php }}-
48+
- name: Cache PHPStan result
49+
uses: actions/cache@v4
50+
with:
51+
path: /tmp/phpstan
52+
key: phpstan-${{ matrix.php }}-${{ matrix.laravel }}-${{ github.sha }}
53+
restore-keys: |
54+
phpstan-${{ matrix.php }}-${{ matrix.laravel }}-
4555
- name: Set up PHP
4656
uses: shivammathur/setup-php@v2
4757
with:

.github/workflows/tests.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,21 @@ jobs:
7373
cache: npm
7474
- name: Install npm dependencies
7575
run: npm ci
76-
- name: Cache Playwright browsers
76+
- name: Install Chromium system dependencies
77+
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libnss3 libatk-bridge2.0-0 libdrm2 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libxkbcommon0 libpango-1.0-0 libcairo2 libasound2t64
78+
- name: Cache Playwright Chromium
7779
id: playwright-cache
7880
uses: actions/cache@v4
7981
with:
8082
path: ~/.cache/ms-playwright
81-
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
82-
- name: Install Playwright browsers
83+
key: playwright-chromium-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
84+
- name: Install Playwright Chromium
8385
if: steps.playwright-cache.outputs.cache-hit != 'true'
8486
uses: nick-fields/retry@v3
8587
with:
8688
timeout_minutes: 10
8789
max_attempts: 3
88-
command: npx playwright install --with-deps
89-
- name: Install Playwright system dependencies
90-
if: steps.playwright-cache.outputs.cache-hit == 'true'
91-
run: npx playwright install-deps
90+
command: npx playwright install chromium
9291
- name: Wait for MySQL
9392
if: matrix.db == 'mysql'
9493
run: |

0 commit comments

Comments
 (0)