-
Notifications
You must be signed in to change notification settings - Fork 20
103 lines (99 loc) · 3.51 KB
/
test_integration.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Run Integration Tests
permissions:
contents: read
on:
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
- labeled
- unlabeled
branches:
- master
schedule:
- cron: "0 2 * * *"
concurrency:
group: integration-${{ github.head_ref }}
cancel-in-progress: true
jobs:
test_integration:
runs-on: ubuntu-latest
if: >
(github.event_name == 'pull_request' &&
github.event.pull_request.draft == false &&
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/') &&
contains(github.event.pull_request.labels.*.name, 'ci/integrations')) ||
github.event_name == 'schedule'
services:
datadog-agent:
image: gcr.io/datadoghq/agent:latest
ports:
- 8126:8126
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
DD_HOSTNAME: "none"
DD_INSIDE_CI: "true"
steps:
- name: Get GitHub App token
if: github.event_name == 'pull_request'
id: get_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
private-key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
repositories: datadog-api-spec
- name: Checkout code
uses: actions/checkout@v3
- name: Post pending status check
if: github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')
uses: DataDog/github-actions/post-status-check@v2
with:
github-token: ${{ steps.get_token.outputs.token }}
repo: datadog-api-spec
status: pending
context: integration
- name: Install system zstd
run: |
sudo apt-get -y install zstd
echo "ZSTANDARD_LIBRARY=$(find /usr/lib -iname libzstd.so.1)" >> $GITHUB_ENV
- name: Set up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
cache-version: ${{ secrets.CACHE_VERSION }}
- name: Install deps
run: bundle install
- name: Run integration tests
run: ./run-tests.sh
shell: bash
env:
CI: "true"
DD_AGENT_HOST: localhost
DD_ENV: prod
DD_SERVICE: datadog-api-client-ruby
DD_TAGS: "team:integrations-tools-and-libraries"
DD_TEST_CLIENT_API_KEY: ${{ secrets.DD_CLIENT_API_KEY }}
DD_TEST_CLIENT_APP_KEY: ${{ secrets.DD_CLIENT_APP_KEY }}
DD_TRACE_ANALYTICS_ENABLED: "true"
RECORD: "none"
SLEEP_AFTER_REQUEST: "${{ vars.SLEEP_AFTER_REQUEST }}"
- name: Post failure status check
if: failure() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')
uses: DataDog/github-actions/post-status-check@v2
with:
github-token: ${{ steps.get_token.outputs.token }}
repo: datadog-api-spec
status: failure
context: integration
- name: Post success status check
if: "!failure() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')"
uses: DataDog/github-actions/post-status-check@v2
with:
github-token: ${{ steps.get_token.outputs.token }}
repo: datadog-api-spec
status: success
context: integration