feat(docker/ci): migrate Docker and CI from npm to bun

Docker changes:
- Use oven/bun:1-debian as base image instead of node:20-trixie-slim
- Replace npm ci with bun install --frozen-lockfile
- Replace npm run commands with bun run
- Mount bun.lock instead of package-lock.json
- Update cache paths for Bun's cache directory
- Rename NPM_RUN_PRUNE env var to BUN_RUN_PRUNE

CI workflow changes:
- Update bashlib.sh npm-install function to use bun
- Update superset-frontend.yml to use bun run commands
- Update release.yml to use setup-bun action and changesets
- Update superset-e2e.yml to use setup-bun action
- Update superset-playwright.yml to use setup-bun action
- Update superset-translations.yml to use setup-bun action

Note: superset-embedded-sdk and superset-websocket remain on npm
as they are separate packages with their own lockfiles.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2026-02-10 11:46:21 -08:00
parent a44372d994
commit aa94a8eebd
11 changed files with 92 additions and 1915 deletions

View File

@@ -41,21 +41,21 @@ pip-upgrade() {
npm-install() {
cd "$GITHUB_WORKSPACE/superset-frontend"
# cache-restore npm
say "::group::Install npm packages"
echo "npm: $(npm --version)"
# cache-restore bun
say "::group::Install packages with bun"
echo "bun: $(bun --version)"
echo "node: $(node --version)"
npm ci
bun install --frozen-lockfile
say "::endgroup::"
# cache-save npm
# cache-save bun
}
build-assets() {
cd "$GITHUB_WORKSPACE/superset-frontend"
say "::group::Build static assets"
npm run build
bun run build
say "::endgroup::"
}
@@ -67,7 +67,7 @@ build-instrumented-assets() {
if [[ -f "$ASSETS_MANIFEST" ]]; then
echo 'Skip frontend build because instrumented static assets already exist.'
else
npm run build-instrumented
bun run build-instrumented
cache-save instrumented-assets
fi
say "::endgroup::"

View File

@@ -40,48 +40,33 @@ jobs:
git fetch --prune --unshallow
git tag -d `git tag | grep -E '^trigger-'`
- name: Install Node.js
- name: Install Bun
if: env.HAS_TAGS
uses: actions/setup-node@v6
uses: oven-sh/setup-bun@v2
with:
node-version-file: './superset-frontend/.nvmrc'
bun-version: latest
- name: Cache npm
- name: Cache bun
if: env.HAS_TAGS
uses: actions/cache@v5
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Get npm cache directory path
if: env.HAS_TAGS
id: npm-cache-dir-path
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Cache npm
if: env.HAS_TAGS
uses: actions/cache@v5
id: npm-cache # use this to check for `cache-hit` (`steps.npm-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-bun-
- name: Install dependencies
if: env.HAS_TAGS
working-directory: ./superset-frontend
run: npm ci
run: bun install --frozen-lockfile
- name: Run unit tests
if: env.HAS_TAGS
working-directory: ./superset-frontend
run: npm run test -- plugins packages
run: bun run test -- plugins packages
- name: Build packages
if: env.HAS_TAGS
working-directory: ./superset-frontend
run: npm run plugins:build
run: bun run turbo:build
- name: Configure npm and git
if: env.HAS_TAGS
@@ -96,12 +81,12 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
- name: Bump version and publish package(s)
- name: Publish packages with changesets
if: env.HAS_TAGS
working-directory: ./superset-frontend
run: |
git tag -d `git tag | grep -E '^trigger-'`
npm run plugins:release-from-tag
bun run changeset:publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}

View File

@@ -107,12 +107,12 @@ jobs:
uses: ./.github/actions/cached-dependencies
with:
run: testdata
- name: Setup Node.js
- name: Setup Bun
if: steps.check.outputs.python || steps.check.outputs.frontend
uses: actions/setup-node@v6
uses: oven-sh/setup-bun@v2
with:
node-version-file: './superset-frontend/.nvmrc'
- name: Install npm dependencies
bun-version: latest
- name: Install dependencies
if: steps.check.outputs.python || steps.check.outputs.frontend
uses: ./.github/actions/cached-dependencies
with:
@@ -224,12 +224,12 @@ jobs:
uses: ./.github/actions/cached-dependencies
with:
run: playwright_testdata
- name: Setup Node.js
- name: Setup Bun
if: steps.check.outputs.python || steps.check.outputs.frontend
uses: actions/setup-node@v6
uses: oven-sh/setup-bun@v2
with:
node-version-file: './superset-frontend/.nvmrc'
- name: Install npm dependencies
bun-version: latest
- name: Install dependencies
if: steps.check.outputs.python || steps.check.outputs.frontend
uses: ./.github/actions/cached-dependencies
with:

View File

@@ -80,14 +80,14 @@ jobs:
- name: Load Docker Image
run: docker load < docker-image.tar.gz
- name: npm run test with coverage
- name: bun run test with coverage
run: |
mkdir -p ${{ github.workspace }}/superset-frontend/coverage
docker run \
-v ${{ github.workspace }}/superset-frontend/coverage:/app/superset-frontend/coverage \
--rm $TAG \
bash -c \
"npm run test -- --coverage --shard=${{ matrix.shard }}/8 --coverageReporters=json-summary"
"bun run test -- --coverage --shard=${{ matrix.shard }}/8 --coverageReporters=json-summary"
- name: Upload Coverage Artifact
uses: actions/upload-artifact@v6
@@ -138,12 +138,12 @@ jobs:
- name: lint
run: |
docker run --rm $TAG bash -c \
"npm i && npm run lint"
"bun install && bun run lint"
- name: tsc
run: |
docker run --rm $TAG bash -c \
"npm i && npm run plugins:build && npm run type"
"bun install && bun run turbo:build && bun run type"
validate-frontend:
needs: frontend-build
@@ -161,12 +161,12 @@ jobs:
- name: Build Plugins Packages
run: |
docker run --rm $TAG bash -c \
"npm run plugins:build"
"bun run turbo:build"
- name: Build Plugins Storybook
run: |
docker run --rm $TAG bash -c \
"npm run plugins:build-storybook"
"bun run plugins:build-storybook"
test-storybook:
needs: frontend-build
@@ -184,4 +184,4 @@ jobs:
- name: Build Storybook and Run Tests
run: |
docker run --rm $TAG bash -c \
"npm run build-storybook && npx playwright install-deps && npx playwright install chromium && npm run test-storybook:ci"
"bun run build-storybook && bun x playwright install-deps && bun x playwright install chromium && bun run test-storybook:ci"

View File

@@ -98,12 +98,12 @@ jobs:
uses: ./.github/actions/cached-dependencies
with:
run: playwright_testdata
- name: Setup Node.js
- name: Setup Bun
if: steps.check.outputs.python || steps.check.outputs.frontend
uses: actions/setup-node@v6
uses: oven-sh/setup-bun@v2
with:
node-version-file: './superset-frontend/.nvmrc'
- name: Install npm dependencies
bun-version: latest
- name: Install dependencies
if: steps.check.outputs.python || steps.check.outputs.frontend
uses: ./.github/actions/cached-dependencies
with:

View File

@@ -29,21 +29,21 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
- name: Setup Bun
if: steps.check.outputs.frontend
uses: actions/setup-node@v6
uses: oven-sh/setup-bun@v2
with:
node-version-file: './superset-frontend/.nvmrc'
bun-version: latest
- name: Install dependencies
if: steps.check.outputs.frontend
uses: ./.github/actions/cached-dependencies
with:
run: npm-install
- name: lint
- name: Build translations
if: steps.check.outputs.frontend
working-directory: ./superset-frontend
run: |
npm run build-translation
bun run build-translation
babel-extract:
runs-on: ubuntu-24.04