Skip to content

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

Only run latest app db variants on PRs (#78755)

technomancyc7166aaa15bb
diff --git a/.github/workflows/app-db.yml b/.github/workflows/app-db.yml
index 06a91913ac6..550ca534de6 100644
--- a/.github/workflows/app-db.yml
+++ b/.github/workflows/app-db.yml
@@ -19,24 +19,94 @@ env:
CI_CONDUCTOR_WEBHOOK_SECRET: ${{ secrets.CI_CONDUCTOR_WEBHOOK_SECRET }}
jobs:
+ app-db-matrix:
+ if: ${{ !inputs.skip }}
+ runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
+ timeout-minutes: 5
+ name: Determine app DB versions
+ outputs:
+ mariadb: ${{ steps.versions.outputs.mariadb }}
+ mysql: ${{ steps.versions.outputs.mysql }}
+ postgres: ${{ steps.versions.outputs.postgres }}
+ steps:
+ - name: Select versions to test
+ id: versions
+ uses: actions/github-script@v9
+ env:
+ REF_NAME: ${{ github.ref_name }}
+ with:
+ script: | # js
+ const refName = process.env.REF_NAME;
+ const runAll = refName === 'master' || refName.startsWith('release-x');
+
+ const versions = {
+ mariadb: [
+ {
+ name: 'MariaDB 10.6',
+ image: 'metabase/mariadb:10.6',
+ 'junit-name': 'be-tests-mariadb-10-6-ee',
+ env: { 'enable-ssl-tests': 'false' },
+ latest: false
+ },
+ {
+ name: 'MariaDB Latest',
+ image: 'mariadb:latest',
+ 'junit-name': 'be-tests-mariadb-latest-ee',
+ env: { 'enable-ssl-tests': 'false' },
+ latest: true
+ },
+ ],
+ mysql: [
+ {
+ name: 'MySQL 8.0',
+ image: 'mysql:8.0',
+ 'junit-name': 'be-tests-mysql-8-0-ee',
+ env: { 'enable-ssl-tests': 'false', 'enable-aws-iam-tests': 'false' },
+ latest: false
+ },
+ {
+ name: 'MySQL 9',
+ image: 'mysql:9',
+ 'junit-name': 'be-tests-mysql-9-ee',
+ env: { 'enable-ssl-tests': 'true', 'enable-aws-iam-tests': 'true' },
+ // treating 9.0 as latest until we introduce mysql 26+ support
+ latest: true
+ },
+ ],
+ postgres: [
+ {
+ name: 'Postgres 14.x',
+ 'junit-name': 'be-tests-postgres-ee',
+ image: 'postgres:14-alpine',
+ env: { 'enable-ssl-tests': 'false', 'enable-aws-iam-tests': 'false' },
+ latest: false,
+ },
+ {
+ name: 'Postgres Latest',
+ 'junit-name': 'be-tests-postgres-latest-ee',
+ image: 'postgres:latest',
+ env: { 'enable-ssl-tests': 'true', 'enable-aws-iam-tests': 'true' },
+ latest: true,
+ },
+ ],
+ };
+
+
+ for (const [db, dbVersions] of Object.entries(versions)) {
+ const selected = runAll ? dbVersions : dbVersions.filter((version) => version.latest);
+ core.info(`${db}: ${selected.map((version) => version.name).join(', ')}`);
+ core.setOutput(db, JSON.stringify(selected));
+ }
+
be-tests-mariadb:
+ needs: app-db-matrix
if: ${{ !inputs.skip }}
runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
- version:
- - name: MariaDB 10.6
- junit-name: be-tests-mariadb-10-6-ee
- image: metabase/mariadb:10.6 # https://github.com/metabase/metabase-mariadb-docker-image
- env:
- enable-ssl-tests: 'false'
- - name: MariaDB Latest
- junit-name: be-tests-mariadb-latest-ee
- image: mariadb:latest
- env:
- enable-ssl-tests: 'false'
+ version: ${{ fromJSON(needs.app-db-matrix.outputs.mariadb) }}
job:
- name: Enterprise Tests
build-static-viz: false
@@ -127,34 +197,14 @@ jobs:
quarantine-engine: ${{ vars.QUARANTINE_ENGINE }}
be-tests-mysql:
+ needs: app-db-matrix
if: ${{ !inputs.skip }}
runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
- version:
- - name: MySQL 8.0
- junit-name: be-tests-mysql-8-0-ee
- image: mysql:8.0
- env:
- enable-ssl-tests: 'false'
- enable-aws-iam-tests: 'false'
- - name: MySQL 9
- junit-name: be-tests-mysql-9-ee
- image: mysql:9
- env:
- enable-ssl-tests: 'true'
- enable-aws-iam-tests: 'true'
- # `mysql:latest` now resolves to MySQL 26.x, which fails in a way that floods the log
- # until the runner cancels the job. A cancelled job can't be soft-failed with
- # continue-on-error, so the leg is disabled until 26.x is supported.
- # - name: MySQL Latest
- # junit-name: be-tests-mysql-latest-ee
- # image: mysql:latest
- # env:
- # enable-ssl-tests: 'false'
- # enable-aws-iam-tests: 'false'
+ version: ${{ fromJSON(needs.app-db-matrix.outputs.mysql) }}
job:
- name: Enterprise Tests
build-static-viz: false
@@ -253,25 +303,14 @@ jobs:
quarantine-engine: ${{ vars.QUARANTINE_ENGINE }}
be-tests-postgres:
+ needs: app-db-matrix
if: ${{ !inputs.skip }}
runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
- version:
- - name: Postgres 14.x
- junit-name: postgres-ee
- docker-image: postgres:14-alpine
- env:
- enable-ssl-tests: 'false'
- enable-aws-iam-tests: 'false'
- - name: Postgres Latest
- junit-name: postgres-latest-ee
- docker-image: postgres:latest
- env:
- enable-ssl-tests: 'true'
- enable-aws-iam-tests: 'true'
+ version: ${{ fromJSON(needs.app-db-matrix.outputs.postgres) }}
job:
- name: Enterprise Tests
build-static-viz: false
@@ -332,7 +371,7 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_AURORA_IAM_SECRET_ACCESS_KEY }}
services:
postgres:
- image: ${{ matrix.version.docker-image }}
+ image: ${{ matrix.version.image }}
ports:
- "5432:5432"
env:
@@ -346,7 +385,7 @@ jobs:
uses: ./.github/actions/test-driver
with:
build-static-viz: ${{ matrix.job.build-static-viz }}
- junit-name: 'be-tests-${{ matrix.version.junit-name }}'
+ junit-name: ${{ matrix.version.junit-name }}
artifact-suffix: ${{ matrix.job.name }}
test-args: >-
${{ matrix.job.test-args }}
@@ -355,6 +394,7 @@ jobs:
app-db-tests-result:
needs:
+ - app-db-matrix
- be-tests-mariadb
- be-tests-mysql
- be-tests-postgres