Repository navigation
70 lines (57 loc) · 1.89 KB
/
Copy pathchecks.yaml
File metadata and controls
70 lines (57 loc) · 1.89 KB
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
name: Checks
on:
pull_request:
branches:
- develop
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
name: Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Node.js at the Volta pin in package.json.
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: npm
- name: Install dependencies
id: install
run: npm ci
# Each check runs even when an earlier one fails, so a pull request
# sees every failure at once.
- name: Type-check
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: npm run check
- name: Check formatting
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: npm run format:check
- name: Build the site
id: build
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: npx astro build
- name: Run the site check
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: npm run site-check
- name: Run the unit tests
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: npm test
# Offline, as `npm run link-check` runs it, with lychee.toml's settings.
- name: Check internal links
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
uses: lycheeverse/lychee-action@v2
with:
args: --offline --root-dir "${{ github.workspace }}/dist" 'dist/**/*.html'
# The pages and thresholds are in lighthouserc.yml.
- name: Run Lighthouse
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
uses: treosh/lighthouse-ci-action@v12
with:
configPath: ./lighthouserc.yml
uploadArtifacts: true