-
Notifications
You must be signed in to change notification settings - Fork 440
56 lines (48 loc) · 1.75 KB
/
test-apps.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
47
48
49
50
51
52
53
54
55
56
name: Test Apps
on:
workflow_dispatch: {} # manually
schedule:
- cron: "0 0 * * *" # nightly
pull_request: {} # on pull request
env:
DD_ENV: github
DD_TAGS: "github_run_id:${{ github.run_id }} github_run_number:${{ github.run_number }}"
jobs:
unit-of-work:
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'DataDog/dd-trace-go')
strategy:
matrix:
include:
- job_name: prod
api_key: "DD_TEST_APP_API_KEY"
datadog_site: datadoghq.com
- job_name: staging
api_key: "DD_TEST_AND_DEMO_API_KEY"
datadog_site: datad0g.com
name: "unit-of-work (${{ matrix.job_name }})"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: 'DataDog/dd-trace-go'
- uses: datadog/[email protected]
with:
api_key: ${{ secrets[matrix.api_key] }}
datadog_site: ${{ matrix.datadog_site }}
- uses: actions/setup-go@v3
with:
go-version: 'stable'
check-latest: true
cache: true
- name: "Configure nightly run to last 10 minutes and add nightly:true tag"
if: (github.event_name == 'schedule')
run: |
# 660s is enough time to capture 10 profiles without missing the last one
# (TODO: Implement profiler.StopFlush())
echo "DD_TEST_APPS_TOTAL_DURATION=660s" >> $GITHUB_ENV
echo "DD_TEST_APPS_PROFILE_PERIOD=60s" >> $GITHUB_ENV
echo "DD_TAGS=${DD_TAGS} nightly:true" >> $GITHUB_ENV
- name: Run unit of work app
run: |
cd ./internal/apps/unit-of-work && ./run.bash