-
Notifications
You must be signed in to change notification settings - Fork 962
142 lines (119 loc) Β· 4.36 KB
/
Copy pathCI.yml
File metadata and controls
142 lines (119 loc) Β· 4.36 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: CI
on:
push:
branches:
- "**"
pull_request:
types: [opened, synchronize]
workflow_dispatch:
# to execute once a day (more info see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule )
schedule:
- cron: "0 0 * * *"
jobs:
build:
if: >-
(
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.repository
)
&& (
github.event_name != 'schedule'
|| github.repository_owner == 'conventional-changelog'
)
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04, windows-2022, windows-2025]
# 22 = Ubuntu 26.04 LTS
node: [22, 24]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
# pnpm version is sourced from package.json `packageManager` field.
- name: Setup pnpm
uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm build
- name: Test
run: pnpm test
codeQuality:
name: Code quality
if: >-
(
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.repository
)
&& (
github.event_name != 'schedule'
|| github.repository_owner == 'conventional-changelog'
)
needs: [build]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Setup pnpm
uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check format
run: pnpm format || (pnpm format-fix; git diff; echo "Formatting did not match (see above diff), please run 'pnpm format-fix'" >&2 && exit 1)
- name: Lint
run: pnpm lint
# oxlint has no equivalent of the eslint vitest/no-focused-tests rule,
# so a stray it.only / describe.only would silently disable the rest of
# a test file. This step is the safety net; the same check also runs
# via lint-staged on pre-commit. See scripts/check-no-focused-tests.js.
- name: Check no focused tests
run: pnpm check-no-focused-tests
nodeJsBaselineAptCompatibility:
name: NodeJS installed from stock Ubuntu-LTS packages (not external sources)
if: >-
(
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.repository
)
&& (
github.event_name != 'schedule'
|| github.repository_owner == 'conventional-changelog'
)
runs-on: ubuntu-24.04
container:
image: "ubuntu:26.04"
steps:
- uses: actions/checkout@v7
- name: Install dependencies
run: |
apt update --yes
# NOTE: do not change the below with an `actions/setup-node` step! or it
# would make this CI job entirely pointless.
#
# `git` is needed because the test suite bootstraps throwaway repos via
# `git init`. It used to arrive as an apt Recommends of the npm chain,
# but on ubuntu:26.04 apt stopped pulling that recommend in (same image
# digest, same node/npm versions), so install it explicitly. The
# checkout step runs before this and uses the REST API fallback either
# way, which is fine β the tests create their own repos.
apt install --yes nodejs npm git
# Ubuntu's bundled corepack (with stock Node) trips on the dynamic
# ESM imports pnpm 11 uses at launch (ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING).
# Install pnpm directly via npm so this job stays honest about
# "stock apt + one explicit pnpm install" rather than papering over
# a packaging mismatch.
PNPM_VERSION=$(node -p "require('./package.json').packageManager.split('@')[1].split('+')[0]")
npm install --global pnpm@${PNPM_VERSION}
pnpm install --frozen-lockfile
- name: Print versions
run: node --version && npm --version && pnpm --version
- name: Build
run: pnpm build
- name: Run Tests
run: pnpm test