From fdc3e370efe980ec62eb7f102980ed2e6b3484c4 Mon Sep 17 00:00:00 2001 From: Vishnu Narayanan Date: Thu, 3 Oct 2024 16:25:48 +0530 Subject: [PATCH] fix: gh actions for vite build (#10212) Fixes https://linear.app/chatwoot/issue/CW-3604/fix-gh-actions-for-vite-build - [x] response bot spec - [x] chatwoot ce spec - [x] size limit check --- .github/workflows/run_response_bot_spec.yml | 10 +++++++--- .github/workflows/size-limit.yml | 20 +++++++++++++++----- package.json | 2 +- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run_response_bot_spec.yml b/.github/workflows/run_response_bot_spec.yml index c594ff404..c788a0400 100644 --- a/.github/workflows/run_response_bot_spec.yml +++ b/.github/workflows/run_response_bot_spec.yml @@ -49,13 +49,17 @@ jobs: with: bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - uses: pnpm/action-setup@v2 + with: + version: 9.3.0 + - uses: actions/setup-node@v4 with: node-version: 20 - cache: yarn + cache: pnpm - - name: yarn - run: yarn install + - name: pnpm + run: pnpm install - name: Create database run: bundle exec rake db:create diff --git a/.github/workflows/size-limit.yml b/.github/workflows/size-limit.yml index 0526aeedb..0758ca7d0 100644 --- a/.github/workflows/size-limit.yml +++ b/.github/workflows/size-limit.yml @@ -19,23 +19,33 @@ jobs: with: bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - uses: pnpm/action-setup@v2 + with: + version: 9.3.0 + - uses: actions/setup-node@v4 with: node-version: 20 - cache: 'yarn' + cache: 'pnpm' - - name: yarn - run: yarn install + - name: pnpm + run: pnpm install - name: Strip enterprise code run: | rm -rf enterprise rm -rf spec/enterprise + - name: setup env + run: | + cp .env.example .env + - name: Run asset compile run: bundle exec rake assets:precompile env: - NODE_OPTIONS: --openssl-legacy-provider + RAILS_ENV: production - name: Size Check - run: yarn run size + run: pnpm run size + + diff --git a/package.json b/package.json index ac7ca4479..f43819b41 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "size-limit": [ { - "path": "public/packs/js/widget-*.js", + "path": "public/vite/assets/widget-*.js", "limit": "300 KB" }, {