-
Notifications
You must be signed in to change notification settings - Fork 6
68 lines (61 loc) · 1.83 KB
/
multiservice-discovery-diff.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
59
60
61
62
63
64
65
66
67
68
name: multiservice-discovery diff
on:
push:
branches:
- add-multiservice-discovery-diff
# on:
# pull_request:
# paths:
# - 'rs/ic-observability/multiservice-discovery/src/*'
# types:
# - opened
# - synchronize
jobs:
compute-targets-diff:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: "make registry dir"
shell: bash
run: |
set -eExuo pipefail
mkdir -p registry
- name: Setup upterm session
uses: lhotari/action-upterm@v1
- name: branch-run
id: branch-run
run: |
bazel run //rs/ic-observability/multiservice-discovery -- --targets-dir registry
until curl -sL -o /dev/null http://localhost:8000; do
sleep 5
elapsed=$((elapsed + 5))
if [ $elapsed -ge 300 ]; then
echo "Timeout reached. Exiting."
exit 1
fi
done
result=(curl -sL http://localhost:8000/prom/targets)
echo "result=$result" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: main
- name: main run
id: main-run
run: |
bazel run //rs/ic-observability/multiservice-discovery -- --targets-dir /
until curl -sL -o /dev/null http://localhost:8000; do
sleep 5
elapsed=$((elapsed + 5))
if [ $elapsed -ge 300 ]; then
echo "Timeout reached. Exiting."
exit 1
fi
done
result=(curl -sL http://localhost:8000/prom/targets)
echo "result=$result" >> $GITHUB_OUTPUT
- uses: int128/diff-action@v1
with:
base: ${{ steps.main-run.outputs.result }}
head: ${{ steps.branch-run.outputs.result }}