-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from MTES-MCT/chore/a11y
Setup lighthouse
- Loading branch information
Showing
37 changed files
with
5,842 additions
and
1,195 deletions.
There are no files selected for viewing
19 changes: 2 additions & 17 deletions
19
.github/workflows/tests.yml → .github/workflows/client-e2e-tests.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Client unit tests | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
client-unit-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run test:unit -w client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Lighthouse desktop | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
lighthouse-desktop: | ||
runs-on: ubuntu-latest | ||
env: | ||
LANDBOT_CONFIG_URL: ${{ secrets.LANDBOT_CONFIG_URL }} | ||
PUBLIC_BORIS_CMS_URL: ${{ secrets.PUBLIC_BORIS_CMS_URL }} | ||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run build -w client | ||
- run: npm run preview -w client & npm run lighthouse-desktop -w client | ||
- name: Upload Lighthouse Report | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
include-hidden-files: true | ||
name: lighthouse-report-${{ matrix.runs-on }} | ||
path: ${{ github.workspace }}/client/.lighthouseci/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Lighthouse mobile | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
lighthouse-mobile: | ||
runs-on: ubuntu-latest | ||
env: | ||
LANDBOT_CONFIG_URL: ${{ secrets.LANDBOT_CONFIG_URL }} | ||
PUBLIC_BORIS_CMS_URL: ${{ secrets.PUBLIC_BORIS_CMS_URL }} | ||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run build -w client | ||
- run: npm run preview -w client & npm run lighthouse-mobile -w client | ||
- name: Upload Lighthouse Report | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
include-hidden-files: true | ||
name: lighthouse-report-${{ matrix.runs-on }} | ||
path: ${{ github.workspace }}/client/.lighthouseci/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"ci": { | ||
"collect": { | ||
"url": ["http://localhost:4173/"], | ||
"numberOfRuns": 1, | ||
"settings": { | ||
"preset": "desktop" | ||
} | ||
}, | ||
"assert": { | ||
"assertions": { | ||
"categories:performance": ["error", { "minScore": 0.8 }], | ||
"categories:accessibility": ["error", { "minScore": 1 }] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"ci": { | ||
"collect": { | ||
"url": ["http://localhost:4173"], | ||
"numberOfRuns": 1 | ||
}, | ||
"assert": { | ||
"assertions": { | ||
"categories:performance": ["error", { "minScore": 0.5 }], | ||
"categories:accessibility": ["error", { "minScore": 1 }] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
import postcssCustomMedia from 'postcss-custom-media'; | ||
import postcssGlobalData from '@csstools/postcss-global-data'; | ||
import { purgeCSSPlugin } from '@fullhuman/postcss-purgecss'; | ||
import cssNano from 'cssnano'; | ||
|
||
export default { | ||
plugins: [ | ||
postcssGlobalData({ | ||
files: ['src/assets/styles/_vars.css'], | ||
const plugins = [ | ||
postcssGlobalData({ | ||
files: ['src/assets/styles/_vars.css'], | ||
}), | ||
postcssCustomMedia(), | ||
cssNano({ | ||
preset: 'default', | ||
}), | ||
]; | ||
|
||
if (process.env.NODE_ENV !== 'development') { | ||
plugins.push( | ||
purgeCSSPlugin({ | ||
content: ['./src/**/*.svelte', './src/**/*.html'], | ||
safelist: [/svelte-/, /placement/, /modal/], | ||
}), | ||
postcssCustomMedia(), | ||
], | ||
); | ||
} | ||
|
||
export default { | ||
plugins, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.