@@ -5,11 +5,17 @@ inputs:
5
5
api-key :
6
6
description : " Datadog API key"
7
7
required : true
8
+ version :
9
+ description : " DataDog CI binary version to use"
10
+ required : false
11
+ default : " v2.48.0"
8
12
runs :
9
13
using : " composite"
10
14
steps :
11
15
- shell : bash
12
16
run : |
17
+ set -e
18
+
13
19
owner=${{ github.repository_owner }}
14
20
echo "owner: $owner"
15
21
if [[ $owner != "coder" ]]; then
21
27
echo "No API key provided, skipping..."
22
28
exit 0
23
29
fi
24
- npm install -g @datadog/datadog-ci@2.21.0
25
- datadog-ci junit upload --service coder ./gotests.xml \
30
+
31
+ TMP_DIR=$(mktemp -d)
32
+ BINARY_VERSION="${{ inputs.version }}"
33
+
34
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
35
+ BINARY_PATH="${TMP_DIR}/datadog-ci.exe"
36
+ BINARY_URL="https://github.com/DataDog/datadog-ci/releases/download/${BINARY_VERSION}/datadog-ci_win-x64"
37
+ elif [[ "${{ runner.os }}" == "macOS" ]]; then
38
+ BINARY_PATH="${TMP_DIR}/datadog-ci"
39
+ BINARY_URL="https://github.com/DataDog/datadog-ci/releases/download/${BINARY_VERSION}/datadog-ci_darwin-arm64"
40
+ elif [[ "${{ runner.os }}" == "Linux" ]]; then
41
+ BINARY_PATH="${TMP_DIR}/datadog-ci"
42
+ BINARY_URL="https://github.com/DataDog/datadog-ci/releases/download/${BINARY_VERSION}/datadog-ci_linux-x64"
43
+ else
44
+ echo "Unsupported OS: ${{ runner.os }}"
45
+ exit 1
46
+ fi
47
+
48
+ echo "Downloading DataDog CI binary version ${BINARY_VERSION} for ${{ runner.os }}..."
49
+ curl -sSL "$BINARY_URL" -o "$BINARY_PATH"
50
+
51
+ # Make binary executable (not needed for Windows)
52
+ if [[ "${{ runner.os }}" != "Windows" ]]; then
53
+ chmod +x "$BINARY_PATH"
54
+ fi
55
+
56
+ "$BINARY_PATH" junit upload --service coder ./gotests.xml \
26
57
--tags os:${{runner.os}} --tags runner_name:${{runner.name}}
27
58
env :
28
59
DATADOG_API_KEY : ${{ inputs.api-key }}
0 commit comments