-
Notifications
You must be signed in to change notification settings - Fork 34
58 lines (56 loc) · 1.57 KB
/
test-alerts.yaml
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
name: Alerts Promql tests
on:
push:
branches:
- main
paths:
- examples/alerts/**
pull_request:
branches:
- main
merge_group:
types: [ checks_requested ]
workflow_dispatch:
jobs:
pre-job:
runs-on: ubuntu-latest
name: Pre job checks
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- uses: actions/checkout@v4
- id: skip_check
uses: fkirc/[email protected]
with:
cancel_others: false
paths: '["examples/alerts/**"]'
promql-tests:
name: Promql Unit tests
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run Promql tests
run: |
make test-alerts
required-checks:
name: Alerts Promql tests Required Checks
# This check adds a list of checks to one job to simplify adding settings to the repo.
# If a new check is added in this file, and it should be retested on entry to the merge queue,
# it needs to be added to the list below aka needs: [ existing check 1, existing check 2, new check ].
needs: [ promql-tests ]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo '${{ toJSON(needs) }}' | jq -e 'all(.[]; .result == "success" or .result == "skipped")'