Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add size limit CI #366

Merged
merged 9 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,36 @@ jobs:
- name: Lint markdown
run: yarn markdown:linkcheck

size:
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Restore dependencies
uses: actions/cache/restore@v3
with:
path: |
./node_modules
./docs/node_modules
./packages/*/node_modules
./examples/**/node_modules
key: ${{ runner.os }}-yarn

- name: Get build-debug
uses: actions/download-artifact@v4
with:
path: packages
name: build-debug

- name: Size
run: yarn size:no-build

rust_lint_fmt:
runs-on: ubuntu-22.04
if: github.event.pull_request.draft == false
Expand Down
2 changes: 1 addition & 1 deletion examples/reactnative/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -716,4 +716,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: c70448f9d8b13c40c47391af88ee9f69ffe85d63

COCOAPODS: 1.15.2
COCOAPODS: 1.14.3
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
"build-ci": "FORCE_COLOR=true yarn workspaces foreach -vt run build",
"build:all": "FORCE_COLOR=true yarn workspaces foreach -vt --no-private run build",
"build-dev:all": "FORCE_COLOR=true yarn workspaces foreach -vt --no-private run build-dev",
"clean:all": "FORCE_COLOR=true yarn workspaces foreach -p --no-private run clean"
"clean:all": "FORCE_COLOR=true yarn workspaces foreach -p --no-private run clean",
"size": "yarn build:all && cd packages/sdk && yarn size:no-build",
"size:no-build": "cd packages/sdk && yarn size:no-build"
}
}
10 changes: 10 additions & 0 deletions packages/sdk/.size-limit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { SizeLimitConfig } from 'size-limit';

module.exports = [
{
name: 'GRPC web client tree shaking',
path: 'lib/esm/index.js',
limit: '54 KB',
import: '{ ConcordiumGRPCWebClient }',
},
] satisfies SizeLimitConfig;
6 changes: 5 additions & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
],
"devDependencies": {
"@protobuf-ts/plugin": "^2.9.1",
"@size-limit/preset-big-lib": "^11.1.4",
"@testing-library/react-native": "^12.3.1",
"@types/bs58check": "^2.1.0",
"@types/jest": "^26.0.23",
Expand All @@ -73,6 +74,7 @@
"prettier": "^3.2.5",
"react-native": "^0.74.1",
"rimraf": "^5.0.1",
"size-limit": "^11.1.4",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
Expand All @@ -94,7 +96,9 @@
"build": "yarn clean; mkdir -p src/grpc-api; yarn generate && yarn build-dev",
"build-dev": "tsc -p tsconfig.build.json && yarn webpack",
"webpack": "node --loader ts-node/esm ../../node_modules/.bin/webpack --config webpack.config.ts",
"clean": "rimraf -- lib src/grpc-api"
"clean": "rimraf -- lib src/grpc-api",
"size": "yarn build && size-limit",
"size:no-build": "size-limit"
},
"dependencies": {
"@concordium/rust-bindings": "workspace:^",
Expand Down
Loading
Loading