Skip to content

Commit

Permalink
ci(frontend): Add Codecov Bundle Analysis (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric authored Mar 12, 2024
1 parent 8de7516 commit f25edc4
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/js-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "JS CI"

on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'

permissions:
contents: read

jobs:
js-ci:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Run npm install
run: npm install

- name: Run npm build
run: npm run build
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
61 changes: 61 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"vuex": "^4.1.0"
},
"devDependencies": {
"@codecov/vite-plugin": "^0.0.1-beta.4",
"@rushstack/eslint-patch": "^1.7.2",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/eslint-config-prettier": "^9.0.0",
Expand Down
6 changes: 6 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { fileURLToPath, URL } from 'node:url';
import { defineConfig, loadEnv } from "vite";
import vue from '@vitejs/plugin-vue';
import { sentryVitePlugin } from '@sentry/vite-plugin';
import { codecovVitePlugin } from "@codecov/vite-plugin";

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
Expand All @@ -22,6 +23,11 @@ export default defineConfig(({ mode }) => {
release: env.RELEASE,
telemetry: false
}),
codecovVitePlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: "gib-potato",
uploadToken: process.env.CODECOV_TOKEN,
}),
],
build: {
sourcemap: true,
Expand Down

0 comments on commit f25edc4

Please sign in to comment.