Monitoring Tests #277
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |