Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Compile e2e CLJS in parallel with the uberjar build (#78017)

Fraserf051eb94a5ed
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index 3a9154e186e..39acba72996 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -123,9 +123,20 @@ jobs:
- name: Get failed specs
if: github.run_attempt != '1'
- run: echo "specs=$(cat failed-specs)" >> $GITHUB_ENV
+ run: echo "specs=$(cat failed-specs)" >> "$GITHUB_ENV"
+
+ # run-tests.yml compiles this in parallel with the uberjar build. Downloading it is ~10x faster than compiling it here.
+ # Callers without that job (stress tests, coverage shards, cross-run re-runs) fall through to compiling as before.
+ - name: Download pre-built CLJS
+ id: prebuilt-cljs
+ uses: actions/download-artifact@v8
+ continue-on-error: true
+ with:
+ name: e2e-cljs-${{ github.event.pull_request.head.sha || github.sha }}
+ path: target/cljs_dev
- name: Compile CLJS
+ if: steps.prebuilt-cljs.outcome != 'success'
run: bun run build-pure:cljs
- name: Run Metabase
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
index 853b198f1fb..66a7156cc6f 100644
--- a/.github/workflows/run-tests.yml
+++ b/.github/workflows/run-tests.yml
@@ -93,6 +93,32 @@ jobs:
uses: ./.github/workflows/uberjar.yml
secrets: inherit
+ # Compile CLJS in parallel with the uberjar and pass it to each e2e group.
+ # The compile is doesn't depend on MB_EDITION
+ e2e-cljs:
+ name: Compile CLJS for e2e
+ needs: [create-test-plan]
+ if: ${{ !cancelled() && needs.create-test-plan.result == 'success' && needs.create-test-plan.outputs.e2e_all == 'true' }}
+ runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v6
+ - name: Prepare front-end environment
+ uses: ./.github/actions/prepare-frontend
+ - name: Prepare back-end environment
+ uses: ./.github/actions/prepare-backend
+ - name: Compile CLJS
+ run: bun run build-pure:cljs
+ - name: Upload compiled CLJS
+ uses: actions/upload-artifact@v7
+ with:
+ name: e2e-cljs-${{ github.event.pull_request.head.sha || github.sha }}
+ path: target/cljs_dev
+ if-no-files-found: error
+ # Uploads fail when an artifact of this name already exists in the run
+ # replace it rather than fail on a re-run.
+ overwrite: true
+
backend-tests:
if: ${{ !cancelled() && needs.create-test-plan.result == 'success' }}
needs: [create-test-plan]