-
Notifications
You must be signed in to change notification settings - Fork 10
94 lines (91 loc) · 2.88 KB
/
lighthouse.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Run Lighthouse CI
on:
push:
branches: [dev, staging, production]
pull_request:
branches: [dev, staging, production]
jobs:
lighthouse-ci:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.1]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # https://github.com/GoogleChrome/lighthouse-ci/issues/172
- uses: technote-space/get-diff-action@v6
id: git-diff
with:
patterns: |
composer.json
composer.lock
**/*.php
package.json
package-lock.json
**/*.css
**/*.js"
- name: Set up PHP
if: steps.git-diff.outputs.diff
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Cache Composer packages
if: steps.git-diff.outputs.diff
uses: actions/cache@v3
with:
path: vendor
key: php-${{ hashFiles('**/composer.lock') }}
- name: Install Dependencies
if: steps.git-diff.outputs.diff
run: composer install -q --no-dev --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- uses: actions/setup-node@v4
if: steps.git-diff.outputs.diff
with:
node-version-file: ".nvmrc"
- name: Cache node modules
if: steps.git-diff.outputs.diff
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.git-diff.outputs.diff
run: npm install
env:
CI: true
- name: Copy .env
if: steps.git-diff.outputs.diff
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Create test database
if: steps.git-diff.outputs.diff
run: |
sudo systemctl start mysql.service
mysqladmin create accessibilityexchange --user="root" --password="root"
- name: Generate keys
if: steps.git-diff.outputs.diff
run: |
echo "CIPHERSWEET_KEY=\"$(openssl rand -hex 32)\"" >> .env
php artisan key:generate
- name: Run database migration
if: steps.git-diff.outputs.diff
run: |
php artisan migrate
php artisan storage:link
php artisan serve &
env:
DB_PASSWORD: root
DB_HOST: localhost
- name: Use Node from .nvmrc file
if: steps.git-diff.outputs.diff
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Run Lighthouse CI
if: steps.git-diff.outputs.diff
run: |
npm install -g @lhci/cli@0.9.x
lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}