Repository navigation
120 lines (95 loc) · 3.47 KB
/
Copy pathci.yml
File metadata and controls
120 lines (95 loc) · 3.47 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
pull_request:
push:
branches:
- main
# The token only reads the repository.
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
# `cache: pnpm` is set on purpose. setup-node v6 and later cache
# automatically for npm only, so pnpm needs the explicit input. pnpm is
# installed in the step above, so it is on PATH when the cache reads it.
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: "1"
# Prettier does not format Markdown here. `.prettierignore` gives the
# reason.
- name: Format check
run: pnpm run format:check
- name: Lint
run: pnpm run lint
- name: Typecheck
run: pnpm run typecheck
- name: Test
run: pnpm run test
# The docs build fails on a broken link (`onBrokenLinks: 'throw'`). The
# site imports nothing from the package, so it needs no build.
- name: Docs check
run: pnpm run docs:check
- name: Build
run: pnpm run build
- name: Run the built CLI
run: node packages/devhub/dist/bin.js --version
# llms.txt holds the help and the JSON types of the build. A change to
# a command or a type without `pnpm run build:llms` fails here.
- name: Check llms.txt
run: pnpm run check:llms
# Reads the files of the tarball: the bin, the page and its script,
# and llms.txt. Both release workflows run the same script.
- name: Check the package artifact
run: pnpm run check:artifact
test:
name: Test (${{ matrix.os }})
# DevHub runs on all three hosts. Path code that works on one system can
# fail on another, so the tests, the build, and the package checks run on
# each one. Validate covers Linux. A Windows checkout can have CRLF line
# ends, and npm is a `.cmd` file there, so check:llms and check:artifact
# run here too.
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: "1"
- name: Test
run: pnpm run test
- name: Build
run: pnpm run build
- name: Run the built CLI
run: node packages/devhub/dist/bin.js --version
- name: Check llms.txt
run: pnpm run check:llms
- name: Check the package artifact
run: pnpm run check:artifact