This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 170
60 lines (47 loc) · 1.54 KB
/
mixin.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
name: mixin
on:
push:
paths:
- 'docs/mixin/**'
pull_request:
paths:
- 'docs/mixin/**'
env:
golang-version: 1.19.4
defaults:
run:
working-directory: docs/mixin
jobs:
check-mixin:
runs-on: ubuntu-latest
name: Check monitoring mixin
steps:
- uses: actions/checkout@v3
- name: Set up Go ${{ env.golang-version }}
uses: actions/[email protected]
with:
go-version: ${{ env.golang-version }}
id: go
- uses: actions/setup-go@v3
with:
go-version: ${{ env.golang-version }}
- name: download mixtool
run: go install -a github.com/monitoring-mixins/mixtool/cmd/mixtool@latest
- name: download jsonnetfmt
run: go install -a github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
- name: download promtool
run: |
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//')
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"
- name: download gojsontoyaml
run: go install github.com/brancz/gojsontoyaml@latest
- name: lint
run: make lint
- name: fmt
run: make fmt && git diff --exit-code
- name: build
run: make build
- name: test alerts
run: |
PATH="${PATH}:${GITHUB_WORKSPACE}"
make test