-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3493e59
commit 0d9472c
Showing
3 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{:aliases | ||
{:user/materialize | ||
{:extra-paths ["PWD/modules/drivers/materialize/test"] | ||
:extra-deps {metabase/materialize {:local/root "PWD/modules/drivers/materialize"}}}}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- "**.md" | ||
pull_request: | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Metabase Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: metabase/metabase | ||
ref: v0.46.5 | ||
|
||
- name: Checkout Driver Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
path: modules/drivers/materialize | ||
|
||
- name: Prepare JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
|
||
- 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 | ||
- name: Install Clojure CLI | ||
run: | | ||
curl -O https://download.clojure.org/install/linux-install-1.11.1.1182.sh && | ||
sudo bash ./linux-install-1.11.1.1182.sh | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
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@v2 | ||
with: | ||
name: materialize.metabase-driver.jar | ||
path: resources/modules/materialize.metabase-driver.jar | ||
|
||
# - name: Report test results | ||
# uses: mikepenz/[email protected] | ||
# if: always() | ||
# with: | ||
# report_paths: "**/target/junit/*.xml" | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
version: "3.9" | ||
|
||
services: | ||
materialize: | ||
image: materialize/materialized:latest | ||
container_name: materialize | ||
command: | ||
- --availability-zone=test1 | ||
- --availability-zone=test2 | ||
ports: | ||
- 6875:6875 | ||
- 6877:6877 | ||
- 6878:6878 | ||
healthcheck: | ||
{ | ||
test: curl -f localhost:6878/api/readyz, | ||
interval: 1s, | ||
start_period: 35s, | ||
} |