Add Docker Hub release workflow #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- "**.md" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Metabase Repo | |
uses: actions/checkout@v3 | |
with: | |
repository: metabase/metabase | |
ref: v0.47.0 | |
- name: Checkout Driver Repo | |
uses: actions/checkout@v3 | |
with: | |
path: modules/drivers/materialize | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- 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: isbang/[email protected] | |
with: | |
compose-file: "modules/drivers/materialize/docker-compose.yml" | |
services: | | |
materialize | |
init | |
# 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: "18" | |
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 | |
DRIVERS=materialize clojure -X:dev:drivers:drivers-dev:test:user/materialize | |
- 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@v3 | |
with: | |
name: materialize.metabase-driver.jar | |
path: resources/modules/materialize.metabase-driver.jar |