-
Notifications
You must be signed in to change notification settings - Fork 4
99 lines (94 loc) · 3.08 KB
/
sanity.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: JAR and Docker Sanity Check
on:
schedule:
- cron: "0 6 * * *"
jobs:
download:
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- name: Get metabase.jar (OSS) from Metabase website
run: |
curl -o download.html https://www.metabase.com/start/oss/jar.html
JAR_DOWNLOAD_URL=`grep 'meta http-equiv="refresh"' download.html | grep -oEi 'https://([a-z0-9A-Z\./]*\.jar)'`
echo $JAR_DOWNLOAD_URL > url.txt
echo "----- Downloading JAR from $JAR_DOWNLOAD_URL -----"
curl -OL $JAR_DOWNLOAD_URL
stat ./metabase.jar
date | tee timestamp
- name: Calculate SHA256 checksum
run: sha256sum ./metabase.jar | tee SHA256.sum
- name: Upload JAR as artifact
uses: actions/upload-artifact@v2
with:
name: metabase-jar
path: |
./metabase.jar
./url.txt
./timestamp
./SHA256.sum
check-jar:
runs-on: ubuntu-20.04
name: check (java ${{ matrix.java-version }})
needs: download
timeout-minutes: 10
strategy:
matrix:
java-version: [11, 17]
steps:
- name: Prepare JRE (Java Run-time Environment)
uses: actions/setup-java@v1
with:
java-package: jre
java-version: ${{ matrix.java-version }}
- run: java -version
- uses: actions/download-artifact@v2
name: Retrieve previously downloaded JAR
with:
name: metabase-jar
- name: Reveal its version.properties
run: jar xf metabase.jar version.properties && cat version.properties
- name: Display when and where it was downloaded
run: |
cat timestamp
cat url.txt
- name: Show the checksum
run: cat SHA256.sum
- name: Launch the JAR (and keep it running)
run: java -jar ./metabase.jar &
- name: Wait for Metabase to start
run: while ! curl -s localhost:3000/api/health; do sleep 1; done
timeout-minutes: 3
- name: Check API health
run: curl -s localhost:3000/api/health
check-container:
runs-on: ubuntu-20.04
name: check container
needs: download
timeout-minutes: 10
steps:
- uses: actions/download-artifact@v2
name: Retrieve the checksum of previously downloaded JAR
with:
name: metabase-jar
path: download
- name: Grab metabase.jar from the Docker image
run: |
docker run -d --name testrun --entrypoint sleep metabase/metabase 500
docker cp testrun:/app/metabase.jar ./metabase.jar
docker kill testrun
- name: Show its version.properties
run: jar xf metabase.jar version.properties && cat version.properties
- name: Compare it with the downloaded JAR from the website
run: |
cp download/SHA256.sum .
sha256sum -c SHA256.sum
- name: Launch container
run: docker run -dp 3000:3000 metabase/metabase
timeout-minutes: 5
- run: docker ps
- name: Wait for Metabase to start
run: while ! curl -s localhost:3000/api/health; do sleep 1; done
timeout-minutes: 1
- name: Check API health
run: curl -s localhost:3000/api/health