Skip to content

Commit dbca17c

Browse files
committed
ci(app): Run vite build and report bundle size
1 parent 5cf3962 commit dbca17c

5 files changed

Lines changed: 352 additions & 8 deletions

File tree

.github/workflows/vite.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: TypeScript tests and coverage
2+
3+
on:
4+
push: { branches: [master] }
5+
pull_request: { branches: [master] }
6+
defaults:
7+
run:
8+
working-directory: ./services/datalad
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [22.x, 24.x]
15+
steps:
16+
- uses: actions/checkout@v6
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v6
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: 'yarn'
22+
- run: yarn install
23+
- name: Run production vite build
24+
working-directory: ./packages/openneuro-app
25+
run: yarn build
26+
env:
27+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.pnp.cjs

Lines changed: 174 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openneuro-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"universal-cookie": "^4.0.4"
5353
},
5454
"devDependencies": {
55+
"@codecov/vite-plugin": "^1.9.1",
5556
"@testing-library/dom": "^10.4.0",
5657
"@testing-library/jest-dom": "6.4.2",
5758
"@testing-library/react": "^14.2.1",

packages/openneuro-app/vite.config.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineConfig } from "vite"
22
import { nodePolyfills } from "vite-plugin-node-polyfills"
3+
import { codecovVitePlugin } from "@codecov/vite-plugin"
34

45
/**
56
* Vite plugin to hack a bug injected by the default assetImportMetaUrlPlugin
@@ -32,9 +33,7 @@ export default defineConfig({
3233
build: {
3334
sourcemap: true,
3435
rollupOptions: {
35-
external: [
36-
"/crn/config.js",
37-
],
36+
external: ["/crn/config.js"],
3837
},
3938
},
4039
optimizeDeps: {
@@ -62,5 +61,15 @@ export default defineConfig({
6261
},
6362
],
6463
},
65-
plugins: [workaroundAssetImportMetaUrlPluginBug(), nodePolyfills()],
64+
plugins: [
65+
workaroundAssetImportMetaUrlPluginBug(),
66+
nodePolyfills(),
67+
/** @type {any} */ (
68+
codecovVitePlugin({
69+
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
70+
bundleName: "@openneuro/app",
71+
uploadToken: process.env.CODECOV_TOKEN,
72+
})
73+
),
74+
],
6675
})

0 commit comments

Comments
 (0)