-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (59 loc) · 1.57 KB
/
ci.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
name: Tests
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci
- name: Run Vitest tests
run: npm test
docs:
runs-on: ubuntu-latest
name: Docs check
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci
- name: Generate docs
run: npm run docs
- name: Check docs unchanged
run: |
if [ "$(git diff --ignore-space-at-eol --text docs/*.md README.md | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after running docs script. See status below:"
git diff --ignore-space-at-eol --text docs/*.md README.md
exit 1
fi
format:
runs-on: ubuntu-latest
name: Format check
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci
- name: Check Prettier formatting
run: npx prettier --check .