-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 1.98 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Continuous Integration
env:
HUSKY: 0
on: [push]
jobs:
ci:
name: Complete Check
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install Dependencies
id: pnpmi
run: pnpm install
- name: Check last commit message
id: commitlint-main
if: github.ref_name == 'main'
run: pnpm commitlint --last --verbose
- name: Check commit message
id: commitlint-not_main
if: github.ref_name != 'main'
run: pnpm commitlint --from=origin/main --verbose
- name: Type Check
id: pnpm-typecheck
run: pnpm typecheck
- name: Lint
id: pnpm-lint
run: pnpm lint
- name: Test
id: pnpm-ci-test-main
if: github.ref_name == 'main'
run: pnpm test:all --ci
- name: Test
id: pnpm-ci-test-not_main
if: github.ref_name != 'main'
run: pnpm test -- --ci
- name: Build
id: pnpm-build
run: pnpm build
# This will fail the workflow if the `dist/` directory is different than
# expected.
- name: Compare Directories
id: diff
run: |
if [ ! -d dist/ ]; then
echo "Expected dist/ directory does not exist. See status below:"
ls -la ./
exit 1
fi
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text dist/
exit 1
fi