-
Notifications
You must be signed in to change notification settings - Fork 45
83 lines (67 loc) · 2.77 KB
/
build-test.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
name: build-test
# Run this for pushes to the main branch and for pull requests, and allow this
# to be called from other workflows
on:
push:
branches: ["main"]
pull_request:
workflow_call:
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- run: pnpm install
- name: Dependencies audit
run: pnpm audit --audit-level=high
- name: Check for duplicate dependencies
run: pnpm dedupe --check
- name: Build
run: pnpm run build
- name: Install dependencies in example project
# In order to lint both our main project and the example sub-project, we
# need to install the dependencies for the example project too.
run: pnpm run example:install
- name: Type check
# Though this largely happens as part of `pnpm run build`, there are
# some files that are not part of the publishable build but which we'd
# also like to type-check.
run: pnpm run type:check
- name: Format check
run: pnpm run format:check
- name: Lint check
run: pnpm run lint:check
- name: Spell check
run: pnpm run spell:check
# We run the spell check so we can see the output in CI if/when we like,
# but we won't enforce it, since there are too many technical/product
# words used that are outside the standard dictionary.
continue-on-error: true
- name: Validate markdown links
# Since most of our documentation is in README.md, notably with lots of
# internal anchor links, validate that they're formed properly. As the
# README and documentation is updated, we want to ensure that links
# remain correct. (This also checks external links, though that's a
# secondary concern.)
run: pnpm run md-link:check
- name: Test
# Run the tests and print out the coverage information. In the future,
# we could integrate with Codecov or something.
run: pnpm run test:coverage
- name: Validate the build's packaging CJS and ESM compatibility
# For now, we ignore the named-exports rule, as this gets triggered for
# the `node16 (from ESM)` context, and appears hard to resolve while
# still avoiding these issues:
# - https://github.com/sjdemartini/mui-tiptap/issues/256
# - https://github.com/sjdemartini/mui-tiptap/issues/264
# Ideally we can fix this in the future without breaking Node and NextJS
# contexts.
run: npx @arethetypeswrong/[email protected] --pack --ignore-rules named-exports