Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWS-159: Run Lighthouse tests on CI #1070

Merged
merged 25 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8c6ca0a
Rename github workflow file
johanbissemattsson Jun 14, 2024
6734687
Format workflow file
johanbissemattsson Jun 14, 2024
f6b47cc
Add lighthouseci to github workflow
johanbissemattsson Jun 14, 2024
4a05e11
Fix typo
johanbissemattsson Jun 14, 2024
fcf6654
Add lighthouse config file
johanbissemattsson Jun 14, 2024
4456481
remake lighthouse config file to esm
johanbissemattsson Jun 14, 2024
bba021f
Use lighthouse-ci-action
johanbissemattsson Jun 14, 2024
5ba09a5
Fix urls
johanbissemattsson Jun 14, 2024
411fb37
Build and preview before running lighthouse ci action
johanbissemattsson Jun 14, 2024
eb8744e
Remove preview command again
johanbissemattsson Jun 14, 2024
7100958
Revert to @lhci/cli
johanbissemattsson Jun 17, 2024
623517e
Merge branch 'develop' into feature/LWS-159-run-lighthouse-tests-on-ci
johanbissemattsson Jun 17, 2024
6634c02
Merge branch 'develop' into feature/LWS-159-run-lighthouse-tests-on-ci
johanbissemattsson Jun 17, 2024
57a988c
Update node version
johanbissemattsson Jun 17, 2024
d354cd2
Use no-pwa preset and show warnings instead of errors
johanbissemattsson Jun 18, 2024
610b203
Try fixing github action status
johanbissemattsson Jun 18, 2024
7d9124a
Add LHCI_GITHUB_APP_TOKEN
johanbissemattsson Jun 18, 2024
ebf35aa
Use actions/checkout@v4
johanbissemattsson Jun 18, 2024
e8550b1
Add startServerReadyPattern
johanbissemattsson Jun 18, 2024
ca7906a
Update startServerReadyPattern
johanbissemattsson Jun 18, 2024
121e46f
Update startServerReadyPattern yet again
johanbissemattsson Jun 18, 2024
3e72b7c
Add githubToken to lhci autorun
johanbissemattsson Jun 18, 2024
a819455
Formatting
johanbissemattsson Jun 18, 2024
0b53cc9
add missing character
johanbissemattsson Jun 18, 2024
5e5a012
Remove faulty startServerReadyPattern
johanbissemattsson Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .github/workflows/lxl-web-tests.yml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/lxl-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: lxl-web
on:
push:
branches: [develop]
pull_request:
branches: [develop]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./lxl-web
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup yarn
run: npm install -g yarn
- name: Install lxljs dependency
run: yarn install --frozen-lockfile
working-directory: ./lxljs
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
env:
API_URL: ${{ secrets.API_URL }}
ID_URL: ${{ secrets.ID_URL }}
run: npm run test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
lighthouseci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./lxl-web
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup yarn
run: npm install -g yarn
- name: Install lxljs dependency
run: yarn install --frozen-lockfile
working-directory: ./lxljs
- name: Install dependencies
run: npm ci
- name: Build and run Lighthouse CI
env:
API_URL: ${{ secrets.API_URL }}
ID_URL: ${{ secrets.ID_URL }}
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
run: |
npm run build
npm install -g @lhci/[email protected]
lhci autorun --upload.githubToken="$LHCI_GITHUB_TOKEN" || echo "LHCI failed!"
29 changes: 29 additions & 0 deletions lxl-web/lighthouserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"ci": {
"collect": {
"startServerCommand": "npm run preview",
"url": [
"http://localhost:4173/",
"http://localhost:4173/find?_q=*&_limit=10&_offset=0&_sort=&_i=*",
"http://localhost:4173/h08ndxddfg5v2pjf"
]
},
"assert": {
"preset": "lighthouse:no-pwa",
"assertions": {
"unsized-images": ["warn", { "minScore": 0.9 }],
"unused-javascript": ["warn", { "maxLength": 1 }],
"csp-xss": ["warn", { "minScore": 0.9 }],
"font-display": ["warn", { "minScore": 0.9 }],
"meta-description": ["warn", { "minScore": 0.9 }],
"tap-targets": ["warn", { "minScore": 0.9 }],
"target-size": ["warn", { "minScore": 0.0 }],
"total-byte-weight": ["warn", { "minScore": 0.9 }],
"empty-heading": ["warn", { "minScore": 0.9 }],
"label-content-name-mismatch": ["warn", { "minScore": 0.9 }],
"link-name": ["warn", { "minScore": 0.9 }],
"valid-source-maps": ["warn", { "minScore": 0.9 }]
}
}
}
}
Loading