Skip to content

Commit e27015f

Browse files
authored
chore: tidy up the CI workflow (#19046)
The Lint job built svelte twice because `pnpm check` already runs `pnpm build`, so it now builds once and runs `pnpm -r check` against that build. `.npmrc` and `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` were only read by Playwright's install script, which it dropped in 1.38.
1 parent 5bd3e3c commit e27015f

4 files changed

Lines changed: 43 additions & 37 deletions

File tree

‎.github/actions/setup/action.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Setup'
2+
description: 'Install pnpm, Node.js and the workspace dependencies'
3+
4+
inputs:
5+
node-version:
6+
description: 'The Node version to install'
7+
default: '24'
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
13+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
14+
with:
15+
node-version: ${{ inputs.node-version }}
16+
cache: pnpm
17+
- run: pnpm install --frozen-lockfile
18+
shell: bash

‎.github/workflows/ci.yml‎

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
permissions:
77
contents: read # to fetch code (actions/checkout)
88

9-
env:
10-
# We only install Chromium manually
11-
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
9+
# cancel superseded pull request runs
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
1213

1314
jobs:
1415
Tests:
@@ -33,12 +34,11 @@ jobs:
3334

3435
steps:
3536
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
36-
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
37-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
37+
with:
38+
persist-credentials: false
39+
- uses: $/.github/actions/setup
3840
with:
3941
node-version: ${{ matrix.node-version }}
40-
cache: pnpm
41-
- run: pnpm install --frozen-lockfile
4242
- run: pnpm playwright install chromium
4343
- run: pnpm test
4444
env:
@@ -49,12 +49,11 @@ jobs:
4949
timeout-minutes: 10
5050
steps:
5151
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
52-
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
53-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
52+
with:
53+
persist-credentials: false
54+
- uses: $/.github/actions/setup
5455
with:
5556
node-version: 22
56-
cache: pnpm
57-
- run: pnpm install --frozen-lockfile
5857
- run: pnpm playwright install chromium
5958
- run: pnpm test runtime-runes
6059
env:
@@ -66,13 +65,9 @@ jobs:
6665
timeout-minutes: 5
6766
steps:
6867
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
69-
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
70-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
7168
with:
72-
node-version: 24
73-
cache: pnpm
74-
- name: install
75-
run: pnpm install --frozen-lockfile
69+
persist-credentials: false
70+
- uses: $/.github/actions/setup
7671
- name: install tsgo
7772
run: cd packages/svelte && pnpm i -D @typescript/native-preview
7873
- name: type check
@@ -83,35 +78,29 @@ jobs:
8378
timeout-minutes: 10
8479
steps:
8580
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
86-
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
87-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
8881
with:
89-
node-version: 24
90-
cache: pnpm
91-
- name: install
92-
run: pnpm install --frozen-lockfile
93-
- name: type check
94-
run: pnpm check
95-
- name: lint
96-
if: (${{ success() }} || ${{ failure() }}) # ensures this step runs even if previous steps fail (avoids multiple runs uncovering different issues at different steps)
97-
run: pnpm lint
82+
persist-credentials: false
83+
- uses: $/.github/actions/setup
9884
- name: build and check generated types
99-
if: (${{ success() }} || ${{ failure() }}) # ensures this step runs even if previous steps fail
100-
run: pnpm build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally with `cd packages/svelte && pnpm generate:types` and commit the changes after you have reviewed them"; git diff; exit 1); }
85+
run: pnpm build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally with \`cd packages/svelte && pnpm generate:types\` and commit the changes after you have reviewed them"; git diff; exit 1); }
10186
- name: check browser-support docs page is up to date
87+
if: ${{ !cancelled() }}
10288
run: '{ [ "`git status --porcelain=v1 documentation/docs/07-misc/.generated/`" == "" ] || (echo "The browser-support docs page is out of date — please regenerate it locally with \`cd packages/svelte && pnpm generate:browser-support\` and commit the changes"; git diff documentation/docs/07-misc/.generated/; exit 1); }'
89+
- name: type check
90+
if: ${{ !cancelled() }}
91+
run: pnpm -r check
92+
- name: lint
93+
if: ${{ !cancelled() }}
94+
run: pnpm lint
10395
Benchmarks:
10496
permissions: {}
10597
runs-on: ubuntu-latest
10698
timeout-minutes: 15
10799
steps:
108100
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
109-
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
110-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
111101
with:
112-
node-version: 24
113-
cache: pnpm
114-
- run: pnpm install --frozen-lockfile
102+
persist-credentials: false
103+
- uses: $/.github/actions/setup
115104
- run: pnpm bench
116105
env:
117106
CI: true

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: pnpm install --frozen-lockfile
3939

4040
- name: Build
41-
run: pnpm build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally with `cd packages/svelte && pnpm generate:types` and commit the changes after you have reviewed them"; git diff; exit 1); }
41+
run: pnpm build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally with \`cd packages/svelte && pnpm generate:types\` and commit the changes after you have reviewed them"; git diff; exit 1); }
4242

4343
- name: Create Release Pull Request or Publish to npm
4444
id: changesets

‎.npmrc‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)