Continuous monitoring of distribution channels #160405
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: Continuous monitoring of distribution channels | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '*/10 * * * *' | |
jobs: | |
smoke-tests: | |
name: Run smoke tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
version: [netcoreapp3.1, net6.0] | |
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 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
3.1.x | |
6.0.x | |
- name: Install dependencies | |
run: dotnet restore sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj | |
- name: Build tests | |
run: dotnet build sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj --configuration Release --no-restore | |
- name: Run tests | |
id: distribution-availability | |
run: dotnet test sdk/test/SmokeTests/bin/Release/${{matrix.version}}/AWSXRayRecorder.SmokeTests.dll | |
- name: Publish metric on X-Ray Dotnet SDK distribution availability | |
if: ${{ always() }} | |
run: | | |
if [[ "${{ steps.distribution-availability.outcome }}" == "failure" ]]; then | |
aws cloudwatch put-metric-data --metric-name XRayDotnetSDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 1 --timestamp $(date +%s) | |
else | |
aws cloudwatch put-metric-data --metric-name XRayDotnetSDKDistributionUnavailability --dimensions failure=rate --namespace MonitorSDK --value 0 --timestamp $(date +%s) | |
fi |