Skip to content

Commit a7f03c2

Browse files
ci: move bundle analysis to separate job (#4361)
1 parent c2fb543 commit a7f03c2

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

.github/workflows/ci-bundle.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: CI-Bundle
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_call:
8+
secrets:
9+
CODECOV_TOKEN:
10+
required: false
11+
12+
jobs:
13+
bundle_analysis:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v5
18+
19+
- name: Setup node
20+
id: node
21+
uses: actions/setup-node@v6
22+
23+
- name: Install npm dependencies
24+
run: npm install
25+
26+
- name: Build
27+
env:
28+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
29+
run: npm run build

.github/workflows/ci-windows.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ on:
1212
release_version:
1313
required: true
1414
type: string
15-
secrets:
16-
CODECOV_TOKEN:
17-
required: false
1815

1916
jobs:
2017
build_windows:
@@ -258,7 +255,6 @@ jobs:
258255
env:
259256
BRANCH: ${{ github.head_ref || github.ref_name }}
260257
BUILD_VERSION: ${{ inputs.release_version }}
261-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
262258
COMMIT: ${{ inputs.release_commit }}
263259
run: |
264260
mkdir -p build

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ jobs:
118118
with:
119119
release_commit: ${{ needs.release-setup.outputs.release_commit }}
120120
release_version: ${{ needs.release-setup.outputs.release_version }}
121+
122+
bundle-analysis:
123+
name: Bundle Analysis
124+
needs: release-setup
125+
uses: ./.github/workflows/ci-bundle.yml
121126
secrets:
122127
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
123128

vite.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ export default defineConfig({
5555
ViteEjsPlugin({ header }),
5656
// The Codecov vite plugin should be after all other plugins
5757
codecovVitePlugin({
58-
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
58+
enableBundleAnalysis: true,
5959
bundleName: "sunshine",
6060
uploadToken: process.env.CODECOV_TOKEN,
61+
gitService: "github",
6162
}),
6263
],
6364
root: resolve(assetsSrcPath),

0 commit comments

Comments
 (0)