Skip to content

Commit 72911bb

Browse files
committed
Rename ci python to ci observability
Call make alerts and ensure no uncommited files exists
1 parent cacd555 commit 72911bb

File tree

4 files changed

+68
-36
lines changed

4 files changed

+68
-36
lines changed

.github/workflows/bicep-lint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
az bicep install -v v0.33.93
2525
az bicep version
2626
make fmt
27-
make modules/metrics/rules/generatedPrometheusAlertingRules.bicep
2827
make lint
2928
- name: Check for uncommitted changes
3029
working-directory: './dev-infrastructure'
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: 'ci-observability'
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
paths:
7+
- '.github/workflows/ci-python.yml'
8+
- 'observability/**'
9+
types:
10+
- opened
11+
- synchronize
12+
- reopened
13+
- closed
14+
jobs:
15+
test-grafana-script:
16+
runs-on: 'ubuntu-latest'
17+
steps:
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
with:
20+
fetch-depth: 1
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.9'
24+
- run: cd observability/grafana && make test
25+
- run: |
26+
cd observability/grafana &&
27+
pip install black &&
28+
make format
29+
- run: |
30+
if [[ ! -z "$(git status --short)" ]]
31+
then
32+
echo "there are some modified files, rerun 'make format' to update them and check the changes in"
33+
git status
34+
exit 1
35+
fi
36+
test-prometheus-rules:
37+
runs-on: 'ubuntu-latest'
38+
steps:
39+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
with:
41+
fetch-depth: 1
42+
- name: 'Set up Go'
43+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
44+
with:
45+
go-version-file: 'go.work'
46+
check-latest: true
47+
- name: 'Install promtool'
48+
run: |
49+
cd $(mktemp -d)
50+
curl -sfLo - https://github.com/prometheus/prometheus/releases/download/v3.2.1/prometheus-3.2.1.linux-amd64.tar.gz | tar xzf -
51+
sudo mv prometheus-3.2.1.linux-amd64/promtool /usr/local/bin/promtool
52+
chmod +x /usr/local/bin/promtool
53+
- name: 'Make alerts'
54+
run: |
55+
# https://github.com/actions/runner-images/issues/11987
56+
az config set bicep.use_binary_from_path=false
57+
az bicep install
58+
cd observability &&
59+
make alerts
60+
- name: 'Ensure all changes are persisted'
61+
run: |-
62+
if [[ ! -z "$(git status --short)" ]]
63+
then
64+
echo "there are some modified files, rerun 'make alerts' to update them and check the changes in"
65+
git status
66+
exit 1
67+
fi

.github/workflows/ci-python.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

observability/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ kubernetesControlPlane-prometheusRule:
88
alerts: kubernetesControlPlane-prometheusRule
99
make -C ../tooling/prometheus-rules run
1010
az bicep format -f $$(yq '.prometheusRules.outputBicep' observability.yaml)
11+
.PHONY: alerts

0 commit comments

Comments
 (0)