Skip to content

Commit

Permalink
chore: Run monitor API test at 9am every day
Browse files Browse the repository at this point in the history
  • Loading branch information
lym953 committed Nov 1, 2024
1 parent 7a67421 commit 6fc196d
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/monitor_api_integration_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: integration-tests

on:
push:
pull_request:
schedule:
# 1pm UTC (9am EDT, 8am EST), every day
- cron: "0 13 * * *"

jobs:
integration-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: 18

- name: Cache Node modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Test getting recommended monitors
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
DD_APP_KEY: ${{ secrets.DD_APP_KEY }}
run: npm run test:integration

notify:
runs-on: ubuntu-latest
needs: integration-tests
steps:
- name: Send failure message to Slack
env:
SLACK_CHANNEL: "#serverless-onboarding-and-enablement-ops"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
if: failure()
run: |
set -x
OPS_MESSAGE=":gh-check-passed: Serverless Plugin failed to fetch recommended monitors from monitor API!
Please check GitHub Action log: https://github.com/DataDog/serverless-plugin-datadog/actions/workflows/monitor_api_integration_test.yml"
curl -H "Content-type: application/json" -X POST "$SLACK_WEBHOOK" -d '{
"channel": "'"$SLACK_CHANNEL"'",
"text": "'"$OPS_MESSAGE"'"

0 comments on commit 6fc196d

Please sign in to comment.