Skip to content

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

Consolidate embedding CI workflows (#66075)

Nemanja Glumacba5804041b1a
diff --git a/.github/file-paths.yaml b/.github/file-paths.yaml
index 92dd1aae98c..6f287517b55 100644
--- a/.github/file-paths.yaml
+++ b/.github/file-paths.yaml
@@ -19,7 +19,7 @@ frontend_ci: &frontend_ci
frontend_embedding_sdk_ci: &frontend_embedding_sdk_ci
- ".github/actions/prepare-frontend/**"
- ".github/actions/prepare-backend/**"
- - ".github/workflows/*embedding-sdk*.yml"
+ - ".github/workflows/embedding-sdk*.yml"
frontend_configs: &frontend_configs
- "yarn.lock"
diff --git a/.github/workflows/e2e-component-tests-embedding-sdk-backward-compatibility.yml b/.github/workflows/e2e-component-tests-embedding-sdk-backward-compatibility.yml
deleted file mode 100644
index 1c8fb060896..00000000000
--- a/.github/workflows/e2e-component-tests-embedding-sdk-backward-compatibility.yml
+++ /dev/null
@@ -1,188 +0,0 @@
-# This workflow does the backward compatibility tests
-# between the Embedding SDK package of version N and Embedding SDK Bundle of version N - 1
-# N - 1 is a target of a PR
-name: Embedding SDK backward-compatibility E2E Component Tests
-
-on:
- workflow_call:
- inputs:
- cached-embedding-sdk-dist-artifact-name:
- required: true
- type: string
-
-jobs:
- files-changed:
- name: "SDK backward-compatibility E2E > Check which files changed"
- runs-on: ubuntu-22.04
- timeout-minutes: 3
- outputs:
- e2e_embedding_sdk: ${{ steps.changes.outputs.e2e_embedding_sdk }}
- steps:
- - uses: actions/checkout@v4
- - name: Test which files changed
- uses: dorny/[email protected]
- id: changes
- with:
- token: ${{ github.token }}
- filters: .github/file-paths.yaml
-
- decide-target-ref:
- runs-on: ubuntu-latest
- outputs:
- target-ref: ${{ steps.get-target-ref.outputs.value }}
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 2
-
- - name: Decide ref to checkout
- id: get-target-ref
- run: |
- if [[ "${{ github.event_name }}" == "pull_request" ]]; then
- echo "value=${{ github.base_ref }}" >> "$GITHUB_OUTPUT"
- else
- echo "value=$(git rev-parse HEAD^1)" >> "$GITHUB_OUTPUT"
- fi
-
- # if this is a test on a release branch, we need to check the build requirements
- get-build-requirements:
- name: "SDK backward-compatibility E2E > [Backport only] Get build requirements"
- needs: [decide-target-ref]
- if: |
- !cancelled() &&
- contains(github.base_ref || github.ref, 'release-x')
- runs-on: ubuntu-22.04
- timeout-minutes: 10
- outputs:
- java_version: ${{ fromJson(steps.dependencies.outputs.result).java_version }}
- node_version: ${{ fromJson(steps.dependencies.outputs.result).node_version }}
- steps:
- - uses: actions/checkout@v4
- with:
- ref: ${{ needs.decide-target-ref.outputs.target-ref }}
- sparse-checkout: release
- - name: Prepare build scripts
- run: cd ${{ github.workspace }}/release && yarn && yarn build
- - name: Get build dependencies
- uses: actions/github-script@v7
- id: dependencies
- with:
- script: | # js
- const {
- getBuildRequirements,
- getVersionFromReleaseBranch,
- } = require('${{ github.workspace }}/release/dist/index.cjs');
- const targetBranchName = '${{ github.base_ref || github.ref }}';
-
- const version = getVersionFromReleaseBranch(targetBranchName);
- const requirements = getBuildRequirements(version);
-
- return {
- java_version: requirements.java,
- node_version: requirements.node,
- };
-
- e2e-tests:
- name: "SDK backward-compatibility E2E > Run e2e tests"
- needs: [files-changed, decide-target-ref, get-build-requirements]
- if: |
- !cancelled() &&
- needs.files-changed.outputs.e2e_embedding_sdk == 'true'
- runs-on: ubuntu-22.04
- timeout-minutes: 45
- env:
- MB_EDITION: ee
- DISPLAY: ""
- MB_RUN_MODE: "e2e"
- METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
- # Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
- # Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
- CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
- CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
- CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
- CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
- COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
- TZ: US/Pacific # to make node match the instance tz
- CYPRESS_CI: true
-
- steps:
- - uses: actions/checkout@v4
- with:
- ref: ${{ needs.decide-target-ref.outputs.target-ref }}
-
- - name: Prepare back-end environment
- uses: ./.github/actions/prepare-backend
- with:
- java-version: "${{ needs.get-build-requirements.outputs.java_version || 21 }}"
-
- - name: Prepare front-end environment
- uses: ./.github/actions/prepare-frontend
- with:
- node-version: "${{ needs.get-build-requirements.outputs.node_version }}"
-
- - name: Build uberjar with ./bin/build.sh
- run: ./bin/build.sh
-
- - name: Retrieve Embedding SDK dist artifact
- uses: actions/download-artifact@v4
- with:
- name: ${{ inputs.cached-embedding-sdk-dist-artifact-name }}
- path: ${{ github.workspace }}/resources/embedding-sdk
-
- - name: Prepare Cypress environment
- id: cypress-prep
- uses: ./.github/actions/prepare-cypress
-
- - name: Run Metabase
- run: node e2e/runner/run_cypress_ci.js start
-
- - name: Make app db snapshot
- env:
- CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
- run: node e2e/runner/run_cypress_ci.js snapshot
-
- - name: Run component tests for Embedding SDK
- env:
- CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
- run: |
- node e2e/runner/run_cypress_ci.js component \
- --env grepTags="-@skip-backward-compatibility"
-
- - name: Upload Test Results
- uses: ./.github/actions/upload-test-results
- if: always()
- with:
- input-path: ./target/junit
- output-name: e2e-embedding-sdk
- bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
- aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
- aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
- aws-region: ${{ vars.AWS_REGION }}
- trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
-
- - name: Upload Cypress Artifacts upon failure
- uses: actions/upload-artifact@v4
- if: failure()
- with:
- name: cypress-recording-embedding-sdk-cross-version
- path: |
- ./cypress
- ./logs/test.log
- if-no-files-found: ignore
-
- - name: Publish Summary
- if: failure()
- uses: actions/github-script@v7
- with:
- script: | #js
- const {
- generateReport,
- parseReport,
- formatSummary
- } = require("./.github/scripts/handle-mochawesome-report.js");
-
- const report = await generateReport();
- const results = parseReport(report);
- const summary = formatSummary(results);
-
- await core.summary.addRaw(summary).write();
diff --git a/.github/workflows/e2e-component-tests-embedding-sdk.yml b/.github/workflows/e2e-component-tests-embedding-sdk.yml
deleted file mode 100644
index 6723a06a852..00000000000
--- a/.github/workflows/e2e-component-tests-embedding-sdk.yml
+++ /dev/null
@@ -1,207 +0,0 @@
-name: E2E Component Tests for Embedding SDK
-
-on:
- workflow_call:
- inputs:
- cached-embedding-sdk-dist-artifact-name:
- required: true
- type: string
-
-jobs:
- files-changed:
- name: "SDK e2e > Check which files changed"
- runs-on: ubuntu-22.04
- timeout-minutes: 3
- outputs:
- e2e_embedding_sdk: ${{ steps.changes.outputs.e2e_embedding_sdk }}
- steps:
- - uses: actions/checkout@v4
- - name: Test which files changed
- uses: dorny/[email protected]
- id: changes
- with:
- token: ${{ github.token }}
- filters: .github/file-paths.yaml
-
- # if this is a test on a release branch, we need to check the build requirements
- get-build-requirements:
- name: "SDK e2e > [Backport only] Get build requirements"
- if: |
- !cancelled() &&
- contains(github.base_ref || github.ref, 'release-x')
- runs-on: ubuntu-22.04
- timeout-minutes: 10
- outputs:
- java_version: ${{ fromJson(steps.dependencies.outputs.result).java_version }}
- node_version: ${{ fromJson(steps.dependencies.outputs.result).node_version }}
- steps:
- - uses: actions/checkout@v4
- with:
- sparse-checkout: release
- - name: Prepare build scripts
- run: cd ${{ github.workspace }}/release && yarn && yarn build
- - name: Get build dependencies
- uses: actions/github-script@v7
- id: dependencies
- with:
- script: | # js
- const {
- getBuildRequirements,
- getVersionFromReleaseBranch,
- } = require('${{ github.workspace }}/release/dist/index.cjs');
- const targetBranchName = '${{ github.base_ref || github.ref }}';
-
- const version = getVersionFromReleaseBranch(targetBranchName);
- const requirements = getBuildRequirements(version);
-
- return {
- java_version: requirements.java,
- node_version: requirements.node,
- };
-
- build-uberjar:
- name: "SDK e2e > Build uberjar"
- needs: [files-changed, get-build-requirements]
- if: |
- !cancelled() &&
- needs.files-changed.outputs.e2e_embedding_sdk == 'true'
- runs-on: ubuntu-22.04
- timeout-minutes: 25
- env:
- MB_EDITION: ee
- INTERACTIVE: false
- # make sure that builds on release branches get licenses, because we use them for releases
- SKIP_LICENSES: ${{ github.event_name == 'pull_request' }}
- steps:
- - uses: actions/checkout@v4
-
- - name: Prepare front-end environment
- uses: ./.github/actions/prepare-frontend
- with:
- node-version: "${{ needs.get-build-requirements.outputs.node_version }}"
-
- - name: Prepare back-end environment
- uses: ./.github/actions/prepare-backend
- with:
- java-version: "${{ needs.get-build-requirements.outputs.java_version || 21 }}"
-
- - name: Build uberjar with ./bin/build.sh
- run: ./bin/build.sh
-
- - name: Prepare uberjar artifact
- uses: ./.github/actions/prepare-uberjar-artifact
- with:
- name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar-sdk-tests
-
- e2e-tests:
- name: "SDK e2e > Run e2e tests (React ${{ matrix.react-version }})"
- needs: [get-build-requirements, build-uberjar]
- if: |
- !cancelled() &&
- needs.build-uberjar.result == 'success'
- runs-on: ubuntu-22.04
- timeout-minutes: 45
- strategy:
- matrix:
- react-version: [18, 19]
- fail-fast: false
- env:
- MB_EDITION: ee
- DISPLAY: ""
- MB_RUN_MODE: "e2e"
- METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
- # Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
- # Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
- CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
- CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
- CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
- CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
- COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
- TZ: US/Pacific # to make node match the instance tz
- CYPRESS_CI: true
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Retrieve uberjar artifact for ee
- uses: actions/download-artifact@v4
- with:
- name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar-sdk-tests
-
- - name: Prepare front-end environment
- uses: ./.github/actions/prepare-frontend
-
- - name: Prepare JDK ${{ needs.get-build-requirements.outputs.java_version || 21 }}
- uses: actions/setup-java@v4
- with:
- java-version: ${{ needs.get-build-requirements.outputs.java_version || 21 }}
- distribution: "temurin"
-
- - name: Prepare Cypress environment
- id: cypress-prep
- uses: ./.github/actions/prepare-cypress
-
- - name: Prepare back-end environment
- uses: ./.github/actions/prepare-backend
-
- - name: Retrieve Embedding SDK dist artifact
- uses: actions/download-artifact@v4
- with:
- name: ${{ inputs.cached-embedding-sdk-dist-artifact-name }}
- path: ${{ github.workspace }}/resources/embedding-sdk
-
- - name: Run Metabase
- run: node e2e/runner/run_cypress_ci.js start
-
- - name: Make app db snapshot
- env:
- CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
- run: node e2e/runner/run_cypress_ci.js snapshot
-
- # Has to be run after the app db snapshot is made, as it is not compatible with React 19
- - name: Change React version to ${{ matrix.react-version }}
- run: ./bin/embedding-sdk/change-react-version.bash ${{ matrix.react-version }}
-
- - name: Run component tests for Embedding SDK
- env:
- CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
- run: node e2e/runner/run_cypress_ci.js component
-
- - name: Upload Test Results
- uses: ./.github/actions/upload-test-results
- if: always()
- with:
- input-path: ./target/junit
- output-name: e2e-embedding-sdk-react-${{ matrix.react-version }}
- bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
- aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
- aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
- aws-region: ${{ vars.AWS_REGION }}
- trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
-
- - name: "SDK e2e > Upload Cypress Artifacts upon failure"
- uses: actions/upload-artifact@v4
- if: failure()
- with:
- name: cypress-recording-embedding-sdk-react-${{ matrix.react-version }}
- path: |
- ./cypress
- ./logs/test.log
- if-no-files-found: ignore
-
- - name: "SDK e2e > Publish Summary"
- if: failure()
- uses: actions/github-script@v7
- with:
- script: | #js
- const {
- generateReport,
- parseReport,
- formatSummary
- } = require("./.github/scripts/handle-mochawesome-report.js");
-
- const report = await generateReport();
- const results = parseReport(report);
- const summary = formatSummary(results);
-
- await core.summary.addRaw(summary).write();
diff --git a/.github/workflows/embedding-sdk-component-tests.yml b/.github/workflows/embedding-sdk-component-tests.yml
new file mode 100644
index 00000000000..c89d8319497
--- /dev/null
+++ b/.github/workflows/embedding-sdk-component-tests.yml
@@ -0,0 +1,252 @@
+name: Embedding SDK Component Tests
+
+on:
+ workflow_call:
+ inputs:
+ cached-embedding-sdk-dist-artifact-name:
+ required: true
+ type: string
+
+jobs:
+ sdk-component-tests:
+ name: "SDK component tests (React ${{ matrix.react-version }})"
+ runs-on: ubuntu-22.04
+ timeout-minutes: 45
+ strategy:
+ matrix:
+ react-version: [18, 19]
+ fail-fast: false
+ env:
+ MB_EDITION: ee
+ DISPLAY: ""
+ MB_RUN_MODE: "e2e"
+ METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
+ # Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
+ # Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
+ CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
+ CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
+ CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
+ CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
+ COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
+ TZ: US/Pacific # to make node match the instance tz
+ CYPRESS_CI: true
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Retrieve uberjar artifact for ee
+ uses: actions/download-artifact@v4
+ with:
+ name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
+
+ - name: Retrieve Embedding SDK dist artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: ${{ inputs.cached-embedding-sdk-dist-artifact-name }}
+ path: ${{ github.workspace }}/resources/embedding-sdk
+
+ - name: Prepare front-end environment
+ uses: ./.github/actions/prepare-frontend
+
+ - name: Prepare JDK 21
+ uses: actions/setup-java@v4
+ with:
+ java-version: 21
+ distribution: "temurin"
+
+ - name: Prepare Cypress environment
+ id: cypress-prep
+ uses: ./.github/actions/prepare-cypress
+
+ - name: Run Metabase
+ run: node e2e/runner/run_cypress_ci.js start
+
+ - name: Make app db snapshot
+ env:
+ CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
+ run: node e2e/runner/run_cypress_ci.js snapshot
+
+ # Has to be run after the app db snapshot is made, as it is not compatible with React 19
+ - name: Change React version to ${{ matrix.react-version }}
+ run: ./bin/embedding-sdk/change-react-version.bash ${{ matrix.react-version }}
+
+ - name: Run component tests for Embedding SDK
+ env:
+ CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
+ run: node e2e/runner/run_cypress_ci.js component
+
+ - name: Upload Test Results
+ uses: ./.github/actions/upload-test-results
+ if: always()
+ with:
+ input-path: ./target/junit
+ output-name: e2e-embedding-sdk-react-${{ matrix.react-version }}
+ bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
+ aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
+ aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
+ aws-region: ${{ vars.AWS_REGION }}
+ trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
+
+ - name: "SDK component tests > Upload Cypress Artifacts upon failure"
+ uses: actions/upload-artifact@v4
+ if: failure()
+ with:
+ name: cypress-recording-embedding-sdk-react-${{ matrix.react-version }}
+ path: |
+ ./cypress
+ ./logs/test.log
+ if-no-files-found: ignore
+
+ - name: "SDK component tests > Publish Summary"
+ if: failure()
+ uses: actions/github-script@v7
+ with:
+ script: | #js
+ const {
+ generateReport,
+ parseReport,
+ formatSummary
+ } = require("./.github/scripts/handle-mochawesome-report.js");
+
+ const report = await generateReport();
+ const results = parseReport(report);
+ const summary = formatSummary(results);
+
+ await core.summary.addRaw(summary).write();
+
+ decide-target-ref:
+ runs-on: ubuntu-latest
+ outputs:
+ target-ref: ${{ steps.get-target-ref.outputs.value }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 2
+
+ - name: Decide ref to checkout
+ id: get-target-ref
+ run: |
+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
+ echo "value=${{ github.base_ref }}" >> "$GITHUB_OUTPUT"
+ else
+ echo "value=$(git rev-parse HEAD^1)" >> "$GITHUB_OUTPUT"
+ fi
+
+ # This job ensures that the Embedding SDK package from the current commit (N) works with the
+ # Embedding SDK Bundle (Metabase JAR) from the previous commit (N-1).
+ # N - 1 is a target of a pull request, or a literal previous commit when this job is run on push in a branch.
+ sdk-component-tests-backward-compatibility:
+ name: "SDK component tests (Backward compatibility)"
+ needs: [decide-target-ref]
+ runs-on: ubuntu-22.04
+ timeout-minutes: 45
+ env:
+ MB_EDITION: ee
+ DISPLAY: ""
+ MB_RUN_MODE: "e2e"
+ METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
+ # Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
+ # Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
+ CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
+ CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
+ CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
+ CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
+ COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
+ TZ: US/Pacific # to make node match the instance tz
+ CYPRESS_CI: true
+
+ steps:
+ - name: Check out the code from the previous commit
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ needs.decide-target-ref.outputs.target-ref }}
+
+ - name: Get the actual commit SHA from the checked out branch
+ id: get-commit-sha
+ run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
+
+ - name: Prepare back-end environment
+ uses: ./.github/actions/prepare-backend
+
+ - name: Prepare front-end environment
+ uses: ./.github/actions/prepare-frontend
+
+ - name: Attempt to retrieve the ee uberjar artifact from the previous commit
+ id: download-uberjar
+ uses: ./.github/actions/fetch-artifact
+ with:
+ name: metabase-ee-${{ steps.get-commit-sha.outputs.sha }}-uberjar
+ extract-path: "target/uberjar"
+ output-name: "metabase.jar"
+ continue-on-error: true # do not break the whole job if this step doesn't succeed
+
+ # Build the uberjar from the previous commit only if we couldn't fetch it.
+ # `step.foo.OUTCOME` is important because it looks at the step status *before* continue-on-error is applied.
+ # Do not confuse it with the `step.foo.conclusion`.
+ - name: Build MB uberjar from the commit N-1
+ if: steps.download-uberjar.outcome != 'success'
+ run: ./bin/build.sh
+
+ - name: Retrieve Embedding SDK dist artifact built from the current commit N
+ uses: actions/download-artifact@v4
+ with:
+ name: ${{ inputs.cached-embedding-sdk-dist-artifact-name }}
+ path: ${{ github.workspace }}/resources/embedding-sdk
+
+ - name: Prepare Cypress environment
+ id: cypress-prep
+ uses: ./.github/actions/prepare-cypress
+
+ - name: Run Metabase
+ run: node e2e/runner/run_cypress_ci.js start
+
+ - name: Make app db snapshot
+ env:
+ CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
+ run: node e2e/runner/run_cypress_ci.js snapshot
+
+ - name: Run component tests for Embedding SDK
+ env:
+ CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
+ run: |
+ node e2e/runner/run_cypress_ci.js component \
+ --env grepTags="-@skip-backward-compatibility"
+
+ - name: Upload Test Results
+ uses: ./.github/actions/upload-test-results
+ if: always()
+ with:
+ input-path: ./target/junit
+ output-name: e2e-embedding-sdk
+ bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
+ aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
+ aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
+ aws-region: ${{ vars.AWS_REGION }}
+ trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
+
+ - name: Upload Cypress Artifacts upon failure
+ uses: actions/upload-artifact@v4
+ if: failure()
+ with:
+ name: cypress-recording-embedding-sdk-cross-version
+ path: |
+ ./cypress
+ ./logs/test.log
+ if-no-files-found: ignore
+
+ - name: Publish Summary
+ if: failure()
+ uses: actions/github-script@v7
+ with:
+ script: | #js
+ const {
+ generateReport,
+ parseReport,
+ formatSummary
+ } = require("./.github/scripts/handle-mochawesome-report.js");
+
+ const report = await generateReport();
+ const results = parseReport(report);
+ const summary = formatSummary(results);
+
+ await core.summary.addRaw(summary).write();
diff --git a/.github/workflows/e2e-embedding-sdk-compatibility-tests.yml b/.github/workflows/embedding-sdk-e2e-tests.yml
similarity index 74%
rename from .github/workflows/e2e-embedding-sdk-compatibility-tests.yml
rename to .github/workflows/embedding-sdk-e2e-tests.yml
index 3afce27bbe1..3a2331e0cc5 100644
--- a/.github/workflows/e2e-embedding-sdk-compatibility-tests.yml
+++ b/.github/workflows/embedding-sdk-e2e-tests.yml
@@ -1,78 +1,18 @@
name: "[NOT REQUIRED] SDK Compatibility tests"
on:
- push:
- branches:
- - "master"
- - "release-**"
- pull_request:
- types: [opened, synchronize, reopened]
- branches:
- - "master"
- - "release-**"
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
- cancel-in-progress: true
+ workflow_call:
+ inputs:
+ cached-embedding-sdk-dist-artifact-name:
+ required: true
+ type: string
jobs:
- files-changed:
- name: Check which files changed
- runs-on: ubuntu-22.04
- timeout-minutes: 3
- outputs:
- e2e_embedding_sdk_compatibility: ${{ steps.changes.outputs.e2e_embedding_sdk_compatibility }}
- steps:
- - uses: actions/checkout@v4
- - name: Test which files changed
- uses: dorny/[email protected]
- id: changes
- with:
- token: ${{ github.token }}
- filters: .github/file-paths.yaml
-
- # if this is a test on a release branch, we need to check the build requirements
- get-build-requirements:
- if: |
- !cancelled() &&
- contains(github.base_ref || github.ref, 'release-x')
- runs-on: ubuntu-22.04
- timeout-minutes: 10
- outputs:
- java_version: ${{ fromJson(steps.dependencies.outputs.result).java_version }}
- node_version: ${{ fromJson(steps.dependencies.outputs.result).node_version }}
- steps:
- - uses: actions/checkout@v4
- with:
- sparse-checkout: release
- - name: Prepare build scripts
- run: cd ${{ github.workspace }}/release && yarn && yarn build
- - name: Get build dependencies
- uses: actions/github-script@v7
- id: dependencies
- with:
- script: | # js
- const {
- getBuildRequirements,
- getVersionFromReleaseBranch,
- } = require('${{ github.workspace }}/release/dist/index.cjs');
- const targetBranchName = '${{ github.base_ref || github.ref }}';
-
- const version = getVersionFromReleaseBranch(targetBranchName);
- const requirements = getBuildRequirements(version);
-
- return {
- java_version: requirements.java,
- node_version: requirements.node,
- };
-
get-sample-apps-data:
- if: |
- !cancelled()
runs-on: ubuntu-22.04
timeout-minutes: 10
env:
- # we must support last two stable releases
+ # we must support the last two stable releases
SUPPORTED_RELEASES_COUNT: 2
TEST_SUITES: |
[
@@ -145,51 +85,6 @@ jobs:
matrix: []
};
- build:
- needs: [files-changed, get-build-requirements, get-sample-apps-data]
- if: |
- !cancelled() &&
- needs.files-changed.outputs.e2e_embedding_sdk_compatibility == 'true' &&
- fromJSON(needs.get-sample-apps-data.outputs.matrix)[0] != null
- runs-on: ubuntu-22.04
- timeout-minutes: 25
- env:
- MB_EDITION: ee
- INTERACTIVE: false
- # make sure that builds on release branches get licenses, because we use them for releases
- SKIP_LICENSES: ${{ github.event_name == 'pull_request' }}
- steps:
- - uses: actions/checkout@v4
- - name: Prepare front-end environment
- uses: ./.github/actions/prepare-frontend
- with:
- node-version: "${{ needs.get-build-requirements.outputs.node_version }}"
- - name: Prepare back-end environment
- uses: ./.github/actions/prepare-backend
- with:
- java-version: "${{ needs.get-build-requirements.outputs.java_version || 21 }}"
-
- - name: Build uberjar with ./bin/build.sh
- run: ./bin/build.sh
-
- - name: Prepare uberjar artifact
- uses: ./.github/actions/prepare-uberjar-artifact
- with:
- name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
-
- - name: Build Embedding SDK package
- run: |
- # Remove the matchers to not report false positives on every PR
- # unrelated to embedding (EMB-765)
- echo "::remove-matcher owner=tsc::"
- yarn build-embedding-sdk-package
-
- - name: Prepare Embedding SDK artifact
- uses: actions/upload-artifact@v4
- with:
- name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
- path: resources/embedding-sdk
-
# In order to check compatibility between Sample Apps and Embedding SDK, the job for each sample app:
# - pulls a Sample App
# - starts it
@@ -197,13 +92,13 @@ jobs:
# The job is not required, though if it's failing better to be sure that it's not caused by a breaking change.
# For more details see `Sample Apps compatibility with Embedding SDK tests` in `enterprise/frontend/src/embedding-sdk-package/dev.md`
e2e-sample-apps-tests:
- needs: [get-build-requirements, get-sample-apps-data, build]
+ needs: [get-sample-apps-data]
strategy:
matrix:
test_suite: ${{ fromJSON(needs.get-sample-apps-data.outputs.matrix) }}
environment: ["production", "development"]
if: |
- !cancelled() && needs.build.result == 'success'
+ !cancelled() && needs.get-sample-apps-data.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
name: e2e-sample-app-${{ matrix.test_suite }}-tests-${{ matrix.environment }}-bundle
@@ -324,7 +219,6 @@ jobs:
# The job is not required, though if it's failing better to be sure that it's not caused by a breaking change.
# For more details see `Embedding SDK integration tests with Host Apps` in `enterprise/frontend/src/embedding-sdk-package/dev.md`
e2e-host-apps-tests:
- needs: [get-build-requirements, build]
strategy:
matrix:
test_suite:
@@ -335,8 +229,6 @@ jobs:
"angular-20-host-app-e2e",
]
environment: ["production", "development"]
- if: |
- !cancelled() && needs.build.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
name: e2e-host-app-${{ matrix.test_suite }}-tests-${{ matrix.environment }}-bundle
diff --git a/.github/workflows/embedding-sdk.yml b/.github/workflows/embedding-sdk.yml
index f55a06ff41e..44eb57b2bb3 100644
--- a/.github/workflows/embedding-sdk.yml
+++ b/.github/workflows/embedding-sdk.yml
@@ -14,6 +14,7 @@ jobs:
timeout-minutes: 3
outputs:
e2e_embedding_sdk: ${{ steps.changes.outputs.e2e_embedding_sdk }}
+ e2e_embedding_sdk_compatibility: ${{ steps.changes.outputs.e2e_embedding_sdk_compatibility }}
frontend_embedding_sdk_sources: ${{ steps.changes.outputs.frontend_embedding_sdk_sources }}
embedding_documentation: ${{ steps.changes.outputs.embedding_documentation }}
steps:
@@ -25,7 +26,7 @@ jobs:
token: ${{ github.token }}
filters: .github/file-paths.yaml
- build:
+ build-sdk-package:
needs: [files-changed]
if: |
!cancelled() &&
@@ -53,10 +54,10 @@ jobs:
path: resources/embedding-sdk
embedding-sdk-cli-snippets-type-check:
- needs: [files-changed, build]
+ needs: [files-changed, build-sdk-package]
if: |
needs.files-changed.outputs.frontend_embedding_sdk_sources == 'true' &&
- needs.build.result == 'success'
+ needs.build-sdk-package.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
@@ -72,10 +73,10 @@ jobs:
run: yarn run embedding-sdk:cli-snippets:type-check
embedding-sdk-docs-snippets-type-check:
- needs: [files-changed, build]
+ needs: [files-changed, build-sdk-package]
if: |
needs.files-changed.outputs.embedding_documentation == 'true' &&
- needs.build.result == 'success'
+ needs.build-sdk-package.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
@@ -91,10 +92,10 @@ jobs:
run: yarn run embedding-sdk:docs-snippets:type-check
embedding-sdk-api-documentation-generation-validation:
- needs: [files-changed, build]
+ needs: [files-changed, build-sdk-package]
if: |
needs.files-changed.outputs.frontend_embedding_sdk_sources == 'true' &&
- needs.build.result == 'success'
+ needs.build-sdk-package.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
@@ -140,18 +141,20 @@ jobs:
run: exit 1
# See `Component e2e tests` in `enterprise/frontend/src/embedding-sdk-package/dev.md`
- sdk-e2e-tests:
- name: "SDK e2e tests"
- uses: ./.github/workflows/e2e-component-tests-embedding-sdk.yml
- needs: [build]
+ embedding-sdk-component-tests:
+ name: "SDK component tests"
+ needs: [build-sdk-package, files-changed]
+ if: needs.files-changed.outputs.e2e_embedding_sdk == 'true'
+ uses: ./.github/workflows/embedding-sdk-component-tests.yml
secrets: inherit
with:
cached-embedding-sdk-dist-artifact-name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
- e2e-component-tests-embedding-sdk-backward-compatibility:
- name: "SDK e2e backward compatibility tests"
- uses: ./.github/workflows/e2e-component-tests-embedding-sdk-backward-compatibility.yml
- needs: [build]
+ not-required-embedding-sdk-apps-compatibility-tests:
+ name: "SDK e2e tests for compatibility with (host/sample) apps"
+ needs: [build-sdk-package, files-changed]
+ if: needs.files-changed.outputs.e2e_embedding_sdk_compatibility == 'true'
+ uses: ./.github/workflows/embedding-sdk-e2e-tests.yml
secrets: inherit
with:
cached-embedding-sdk-dist-artifact-name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
@@ -161,8 +164,7 @@ jobs:
- embedding-sdk-cli-snippets-type-check
- embedding-sdk-docs-snippets-type-check
- embedding-sdk-api-documentation-generation-validation
- - sdk-e2e-tests
- - e2e-component-tests-embedding-sdk-backward-compatibility
+ - embedding-sdk-component-tests
if: always() && !cancelled()
runs-on: ubuntu-latest
timeout-minutes: 5
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
index d596fd31b3d..c526f9c28d3 100644
--- a/.github/workflows/run-tests.yml
+++ b/.github/workflows/run-tests.yml
@@ -123,7 +123,7 @@ jobs:
specs: ${{ needs.files-changed.outputs.e2e_all_files == needs.files-changed.outputs.e2e_specs_files && needs.files-changed.outputs.e2e_specs_files || '' }}
sdk-tests:
- needs: files-changed
+ needs: [uberjar]
uses: ./.github/workflows/embedding-sdk.yml
secrets: inherit