This repository was archived by the owner on Apr 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ name: mixin
2
2
on :
3
3
push :
4
4
paths :
5
- - ' docs/mixin/alerts/*.yml '
5
+ - ' docs/mixin/** '
6
6
pull_request :
7
7
paths :
8
- - ' docs/mixin/alerts/*.yml '
8
+ - ' docs/mixin/** '
9
9
10
10
env :
11
11
golang-version : 1.18.0
27
27
with :
28
28
go-version : ${{ env.golang-version }}
29
29
30
+ - name : download dashboard linter
31
+ run : go install -a github.com/grafana/dashboard-linter@latest
32
+
30
33
- name : download promtool
31
- run : go install -a github.com/prometheus/prometheus/cmd/promtool@latest
32
-
33
- - run : make check-alerts
34
+ run : |
35
+ VERSION=$(curl -s https://api.github.com/repos/prometheus/prometheus/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}' | sed 's/v//')
36
+ curl -s -L "https://github.com/prometheus/prometheus/releases/download/v${VERSION}/prometheus-${VERSION}.linux-amd64.tar.gz" | tar -zxf - -C "${GITHUB_WORKSPACE}/" --strip-components 1 "prometheus-${VERSION}.linux-amd64/promtool"
37
+
38
+ - run : |
39
+ PATH="${PATH}:${GITHUB_WORKSPACE}"
40
+ make check-alerts
41
+
42
+ - run : make check-dashboards
Original file line number Diff line number Diff line change @@ -44,5 +44,11 @@ check-alerts:
44
44
# go install -a github.com/prometheus/prometheus/cmd/promtool@latest
45
45
promtool check rules docs/mixin/alerts/alerts.yaml
46
46
47
+ .PHONY : check-dashboards
48
+ check-dashboards :
49
+ # If you don't have promtool, install it with
50
+ # go install -a github.com/grafana/dashboard-linter@latest
51
+ find docs/mixin/dashboards -name ' *.json' -print0 | xargs -n 1 -0 dashboard-linter lint
52
+
47
53
.PHONY : all
48
54
all : build test go-fmt go-lint
Original file line number Diff line number Diff line change
1
+ # Those exclusions are needed due to usage of newer dashboard schema
2
+ exclusions:
3
+ template-datasource-rule:
4
+ panel-datasource-rule:
You can’t perform that action at this time.
0 commit comments