Skip to content

Commit f661377

Browse files
authored
ci: consolidate static checks in lint workflow (#1430)
1 parent 69f1c60 commit f661377

3 files changed

Lines changed: 18 additions & 13 deletions

File tree

.github/workflows/test.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,27 @@ jobs:
7575

7676
- name: Build Packages
7777
run: pnpm run build
78+
env:
79+
# Publish checks are comparatively expensive and only need to run once
80+
# as part of the lint/static-check gate.
81+
RSTEST_PUBLISH_CHECK: true
7882

7983
- name: Lint
8084
run: pnpm run lint
8185

8286
- name: Check Dependency Version
8387
run: pnpm run check-dependency-version
8488

85-
- name: Check pnpm Dedupe
86-
run: pnpm dedupe --check --config.minimum-release-age=0
87-
8889
- name: Check Unused Code
8990
run: pnpm run check-unused
9091

92+
- name: Check pnpm Dedupe
93+
# Keep dedupe last: `pnpm dedupe --check` may leave pnpm's modules
94+
# state needing a reconcile. If another `pnpm run ...` follows it,
95+
# pnpm can enter its implicit install path and rerun lifecycle scripts
96+
# such as the root `prepare`.
97+
run: pnpm dedupe --check --config.minimum-release-age=0
98+
9199
# ======== ut ========
92100
ut:
93101
# Gate behind lint so a lint failure skips the (billed-premium) macOS +
@@ -129,13 +137,6 @@ jobs:
129137
- name: Setup Playwright
130138
uses: ./.github/actions/setup-playwright
131139

132-
- name: Run Type Check
133-
# tsc is OS-independent, so PR runs it on macOS only; the post-merge
134-
# FULL run still typechecks both OSes so push-to-main stays a literal
135-
# superset of PR coverage.
136-
if: needs.prepare.outputs.is_full_run == 'true' || matrix.os == 'macos-latest'
137-
run: pnpm run typecheck
138-
139140
- name: Run Test
140141
run: pnpm run test
141142

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"check-unused": "knip",
1212
"e2e": "cd e2e && pnpm test && pnpm test:commonjs && pnpm test:no-isolate",
1313
"format": "prettier --write . && heading-case --write",
14-
"lint": "prettier --check . && pnpm run check-spell && pnpm lint:type",
15-
"lint:type": "rslint",
14+
"lint": "prettier --check . && pnpm run check-spell && pnpm run lint:type",
15+
"lint:type": "rslint --type-check",
1616
"prepare": "lefthook install && pnpm run build",
1717
"test": "rstest",
1818
"test:examples": "pnpm --filter \"@examples/*\" test",
1919
"test:vscode": "pnpm --filter ./packages/vscode test",
20-
"typecheck": "rslint --type-check-only"
20+
"typecheck": "pnpm run lint:type"
2121
},
2222
"devDependencies": {
2323
"@rsdoctor/rspack-plugin": "^1.5.13",

scripts/publishCheckPlugins.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import { pluginPublint } from 'rsbuild-plugin-publint';
1212
* needing dynamic import are intentional, not bugs.
1313
*/
1414
export function publishCheckPlugins() {
15+
if (process.env.RSTEST_PUBLISH_CHECK !== 'true') {
16+
return [];
17+
}
18+
1519
return [
1620
pluginPublint(),
1721
pluginAreTheTypesWrong({

0 commit comments

Comments
 (0)