-
Notifications
You must be signed in to change notification settings - Fork 795
36 lines (32 loc) · 1.1 KB
/
test.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
name: Test
on:
push:
branches:
- master
workflow_dispatch:
jobs:
test:
name: CI tests
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_LOGIN }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Provision dashboards
run: |
mkdir .github/workflows/all-dashboards
find . ! -path .github/workflows/all-dashboards -type f -name *.json -exec cp {} .github/workflows/all-dashboards \;
docker pull grafana/grafana:latest
docker run --name grafana -d \
-e GF_LOG_CONSOLE_FORMAT=json \
-e GF_LOG_LEVEL=error \
-v $PWD/.github/workflows/provisioning/dashboards/:/etc/grafana/provisioning/dashboards/ \
-v $PWD/.github/workflows/all-dashboards/:/tmp/dashboards/ \
grafana/grafana:latest
sleep 20
ERROR=$(docker logs grafana | jq .)
if [ ! -z "$ERROR" ]; then echo "$ERROR" && exit 1; fi