Skip to content

Commit

Permalink
ci: Setup Codecov bundle analysis 📦
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldev5 committed Sep 6, 2024
1 parent 7d04ae4 commit c3e0e53
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
with:
node-version: 20
cache: "pnpm"
- run: |
touch .env
echo GH_COMMIT_SHA="${{ github.event.pull_request.head.sha }}" >> .env
echo CODECOV_TOKEN="${{ secrets.CODECOV_TOKEN }}" >> .env
- run: pnpm install
- run: pnpm build
- run: pnpm compile
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ node_modules
.turbo
dist
coverage
_PipelineMapping/
_PipelineMapping/
.env
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
},
"resolutions": {
"@polkadot/types-codec": "^12.4.2",
"@polkadot/api": "^12.4.2"
"@polkadot/api": "^12.4.2",
"@crypto-dex-sdk/chain": "0.1.2"
},
"scripts": {
"compile": "turbo run compile",
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@
"devDependencies": {
"@babel/plugin-syntax-import-assertions": "^7.25.6",
"@babel/preset-env": "^7.25.4",
"@codecov/rollup-plugin": "0.0.1-beta.12",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-json": "^6.1.0",
"@types/node": "^22.5.1",
"@vitest/coverage-v8": "^2.0.5",
"dotenv": "^16.4.5",
"prettier": "^3.3.3",
"rollup": "^4.21.1",
"rollup-plugin-dts": "^6.1.1",
Expand Down
13 changes: 13 additions & 0 deletions packages/sdk/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import typescript from 'rollup-plugin-typescript2'
import json from '@rollup/plugin-json'
import dts from 'rollup-plugin-dts'
import { babel } from '@rollup/plugin-babel'
import { codecovRollupPlugin } from '@codecov/rollup-plugin'
import { config } from 'dotenv'

config({ path: '../../.env' })

export default [
{
Expand All @@ -19,6 +23,15 @@ export default [
plugins: ['@babel/plugin-syntax-import-assertions'],
babelHelpers: 'bundled',
presets: ['@babel/preset-env']
}),
codecovRollupPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: 'sdk',
uploadToken: process.env.CODECOV_TOKEN,
debug: true,
uploadOverrides: {
sha: process.env.GH_COMMIT_SHA
}
})
]
},
Expand Down
2 changes: 2 additions & 0 deletions packages/xcm-analyser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@codecov/rollup-plugin": "0.0.1-beta.12",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-json": "^6.1.0",
"@vitest/coverage-v8": "^2.0.5",
"dotenv": "^16.4.5",
"rollup": "^4.21.1",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-typescript2": "^0.36.0",
Expand Down
12 changes: 12 additions & 0 deletions packages/xcm-analyser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import typescript from 'rollup-plugin-typescript2';
import json from '@rollup/plugin-json';
import dts from 'rollup-plugin-dts';
import { babel } from '@rollup/plugin-babel';
import { codecovRollupPlugin } from '@codecov/rollup-plugin';
import { config } from 'dotenv';

config({ path: '../../.env' });

export default [
{
Expand All @@ -17,6 +21,14 @@ export default [
babelHelpers: 'bundled',
presets: ['@babel/preset-env'],
}),
codecovRollupPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: 'xcm-analyser',
uploadToken: process.env.CODECOV_TOKEN,
uploadOverrides: {
sha: process.env.GH_COMMIT_SHA,
},
}),
],
},
{
Expand Down
2 changes: 2 additions & 0 deletions packages/xcm-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@
"@babel/core": "^7.25.2",
"@babel/plugin-syntax-import-assertions": "^7.25.6",
"@babel/preset-env": "^7.25.4",
"@codecov/rollup-plugin": "0.0.1-beta.12",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-json": "^6.1.0",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.5.1",
"@vitest/coverage-v8": "^2.0.5",
"dotenv": "^16.4.5",
"prettier": "^3.3.3",
"rollup": "^4.21.1",
"rollup-plugin-dts": "^6.1.1",
Expand Down
12 changes: 12 additions & 0 deletions packages/xcm-router/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import typescript from 'rollup-plugin-typescript2';
import json from '@rollup/plugin-json';
import dts from 'rollup-plugin-dts';
import { babel } from '@rollup/plugin-babel';
import { codecovRollupPlugin } from '@codecov/rollup-plugin';
import { config } from 'dotenv';

config({ path: '../../.env' });

export default [
{
Expand All @@ -17,6 +21,14 @@ export default [
babelHelpers: 'bundled',
presets: ['@babel/preset-env'],
}),
codecovRollupPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: 'xcm-router',
uploadToken: process.env.CODECOV_TOKEN,
uploadOverrides: {
sha: process.env.GH_COMMIT_SHA,
},
}),
],
},
{
Expand Down
73 changes: 61 additions & 12 deletions pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"test:integration": {},
"test:e2e": {},
"build": {
"cache": false,
"outputs": ["dist/**"],
"dependsOn": ["^build"]
}
Expand Down

0 comments on commit c3e0e53

Please sign in to comment.