-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (71 loc) · 2.34 KB
/
monitoring-tests.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Monitoring Tests
on:
schedule:
- cron: '0 */6 * * *' # At minute 0 past every 6th hour
workflow_dispatch: # allow manually triggering a run
env:
GITHUB_REF: ${{ github.ref }}
jobs:
integration:
name: Monitoring Tests
runs-on: ubuntu-latest
steps:
- name: rust-toolchain
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: nightly
override: true
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Config cargo
run: echo -e "$CARGO_CONFIG_TOML_BREEZ" > .cargo/config.toml
env:
CARGO_CONFIG_TOML_BREEZ: ${{ secrets.CARGO_CONFIG_TOML_BREEZ }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.0
- name: Restore .3l_local_test cache
uses: actions/cache/restore@v4
with:
path: .3l_local_test
key: monitor-local-test-cache
- name: Run monitoring tests
id: monitortest
run: make monitortest
continue-on-error: true
- name: Save .3l_local_test cache
uses: actions/cache/save@v4
with:
path: .3l_local_test
key: monitor-local-test-cache
- name: Cat test results
run: cat test.json
- name: Check test result
run: |
if [ ${{ steps.monitortest.outcome }} == "failure" ]; then
echo "Tests failed"
echo "failure" > test_status.txt
else
echo "Tests passed"
echo "success" > test_status.txt
fi
- name: Process and publish results
run: |
./generate_report.sh "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
TEST_STATUS=$(cat test_status.txt)
if [ "$TEST_STATUS" = "failure" ]; then
curl -X POST \
-H "Content-type: application/json" \
--data "$(cat slack_message.json)" \
${{ secrets.LIPA_SLACK_3L_MONITORING_FAILURE_BOT_WEBHOOK_URL }}
else
curl -X POST \
-H "Content-type: application/json" \
--data "$(cat slack_message.json)" \
${{ secrets.LIPA_SLACK_3L_MONITORING_BOT_WEBHOOK_URL }}
fi