-
Notifications
You must be signed in to change notification settings - Fork 57
46 lines (40 loc) · 1.54 KB
/
continuous-monitoring.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
name: Continuous monitoring of distribution channels
on:
workflow_dispatch:
schedule:
- cron: '*/10 * * * *'
jobs:
smoke-tests:
name: Run smoke tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
env:
TEST_DISTRIBUTION: true
- name: Install dependencies
run: bundle install
env:
TEST_DISTRIBUTION: true
- name: Run distribution test
id: distribution-availability
run: bundle exec rake test_distribution
env:
TEST_DISTRIBUTION: true
- name: Publish metric on X-Ray Ruby SDK distribution availability
if: ${{ always() }}
run: |
if [[ "${{ steps.distribution-availability.outcome }}" == "failure" ]]; then
aws cloudwatch put-metric-data --metric-name XRayRubySDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 1 --timestamp $(date +%s)
else
aws cloudwatch put-metric-data --metric-name XRayRubySDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 0 --timestamp $(date +%s)
fi