forked from DataDog/junit-upload-github-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
72 lines (72 loc) · 2.23 KB
/
action.yaml
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
# Composite action to upload junit test result files to Datadog CI Visibility
name: 'Datadog JUnitXML Upload'
description: 'Upload JUnitXML reports files to Datadog CI Visibility'
inputs:
api-key:
required: true
description: Datadog API key to use to upload the junit files.
service:
required: true
description: Service name to use with the uploaded test results.
datadog-site:
required: true
default: datadoghq.com
description: The Datadog site to upload the files to.
files:
required: true
description: JUnit files to upload.
default: .
concurrency:
required: true
description: Controls the maximum number of concurrent file uploads.
default: "20"
node-version:
required: true
description: The node version used to install datadog-ci
default: "16"
tags:
required: false
description: Datadog tags to associate with the uploaded test results.
env:
required: false
description: Datadog env to use for the tests.
logs:
required: false
description: Set to "true" to enable forwarding content from XML reports as logs.
runs:
using: "composite"
steps:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- name: Get Datadog CLI
shell: bash
run: npm install -g @datadog/datadog-ci
- name: Upload the JUnit files
if: ${{ inputs.logs == 'true' }}
shell: bash
run: |
datadog-ci junit upload \
--service ${{ inputs.service }} \
--logs \
--max-concurrency ${{ inputs.concurrency }} \
${{ inputs.files }}
env:
DATADOG_API_KEY: ${{ inputs.api-key }}
DATADOG_SITE: ${{ inputs.datadog-site }}
DD_ENV: ${{ inputs.env }}
DD_TAGS: ${{ inputs.tags }}
- name: Upload the JUnit files
if: ${{ inputs.logs != 'true' }}
shell: bash
run: |
datadog-ci junit upload \
--service ${{ inputs.service }} \
--max-concurrency ${{ inputs.concurrency }} \
${{ inputs.files }}
env:
DATADOG_API_KEY: ${{ inputs.api-key }}
DATADOG_SITE: ${{ inputs.datadog-site }}
DD_ENV: ${{ inputs.env }}
DD_TAGS: ${{ inputs.tags }}