Skip to content

Upgrade Metabase to v0.52 #155

Upgrade Metabase to v0.52

Upgrade Metabase to v0.52 #155

Workflow file for this run

name: Tests
on:
workflow_dispatch:
pull_request:
branches:
- master
paths-ignore:
- "**.md"
schedule:
- cron: 0 11 * * 0
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Metabase Repo
uses: actions/checkout@v3
with:
repository: metabase/metabase
ref: v0.52.6
- name: Checkout Driver Repo
uses: actions/checkout@v3
with:
path: modules/drivers/materialize
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 21
- name: Add Materialize TLS instance to /etc/hosts
run: |
sudo echo "127.0.0.1 materialize" | sudo tee -a /etc/hosts
- name: Start Materialize in Docker
uses: hoverkraft-tech/[email protected]
with:
compose-file: "modules/drivers/materialize/docker-compose.yml"
services: |
materialize
# Apply the scripts/exclude_tests.diff patch to exclude tests that are not relevant to Materialize
- name: Apply exclude_tests.diff
run: |
git apply modules/drivers/materialize/scripts/exclude_tests.diff
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.11.1.1262.sh &&
sudo bash ./linux-install-1.11.1.1262.sh
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "20"
cache: "yarn"
- name: Get M2 cache
uses: actions/cache@v2
with:
path: |
~/.m2
~/.gitlibs
key: ${{ runner.os }}-materialize-${{ hashFiles('**/deps.edn') }}
- name: Prepare stuff for pulses
run: yarn build-static-viz
# Use custom deps.edn containing "user/materialize" alias to include driver sources
- name: Run tests
run: |
mkdir -p /home/runner/.config/clojure
cat modules/drivers/materialize/.github/deps.edn | sed -e "s|PWD|$PWD|g" > /home/runner/.config/clojure/deps.edn
# Retry tests up to 2 times as the Metabase test data sometimes fails to load on the first try
ATTEMPTS=0
MAX_RETRIES=2
until [ $ATTEMPTS -ge $MAX_RETRIES ]
do
echo "Attempt $(($ATTEMPTS + 1)) of $MAX_RETRIES..."
DRIVERS=materialize clojure -X:dev:drivers:drivers-dev:test:user/materialize && break
ATTEMPTS=$(($ATTEMPTS + 1))
echo "Tests failed. Retrying in 10 seconds..."
sleep 10
done
if [ $ATTEMPTS -eq $MAX_RETRIES ]; then
echo "Tests failed after $MAX_RETRIES attempts."
exit 1
fi
- name: Build Materialize driver
run: |
echo "{:deps {metabase/materialize {:local/root \"materialize\" }}}" > modules/drivers/deps.edn
bin/build-driver.sh materialize
ls -lah resources/modules
- name: Archive driver JAR
uses: actions/upload-artifact@v4
with:
name: materialize.metabase-driver.jar
path: resources/modules/materialize.metabase-driver.jar