Skip to content

Commit

Permalink
Add lighthouse ci github action [WEB-2948]
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiltri committed Dec 19, 2024
1 parent 762a5e7 commit 6a1cca7
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Lighthouse
on: [push]
jobs:
lhci:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 8.10.0
- name: Install NPM
run: npm install --global [email protected]
- name: Install Postgres
id: postgres
uses: ikalnytskyi/action-setup-postgres@v4
with:
username: homestead
password: secret
database: testing
port: 5432
- name: Install Prince
run: |
TEMP_PRINCE="$(mktemp)"
sudo apt-get update; sudo apt-get install gdebi -y
wget https://www.princexml.com/download/prince_15.3-1_ubuntu22.04_amd64.deb -O "${TEMP_PRINCE}"
sudo gdebi "${TEMP_PRINCE}" --n
- name: Checkout code
uses: actions/checkout@v3
- name: Install PHP dependencies
run: composer install --no-interaction --no-progress --no-scripts
# Remove the closer-look dependency. We will not need it for testing
# and, since it is a private package, it requires setting up an SSH
# key in the test runner, which is convoluted.
- name: Remove private NPM package
run: npm uninstall closer-look --save
- name: Migrate database
run: php artisan migrate --env=testing
- name: Generate key
run: php artisan key:generate --env=testing
- name: Build Twill assets
run: php artisan twill:build --env=testing
- name: Build Javascript assets
run: npm run build
- name: Run Lighthouse CI
run: |
npm install -g @lhci/[email protected]
lhci autorun
7 changes: 7 additions & 0 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
ci: {
upload: {
target: 'temporary-public-storage',
},
},
};

0 comments on commit 6a1cca7

Please sign in to comment.