-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Run monitor API test at 9am every day
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
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"'" |