Skip to content

Commit d0605a7

Browse files
Use GitHub action instead of npm package for code coverage upload (#327)
1 parent 2952e1f commit d0605a7

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

.github/workflows/dev.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
matrix:
124124
arch: ["arm64", "amd64"]
125125
include:
126-
- runner: windows-11-arm
126+
- runner: windows-11-arm
127127
arch: arm64
128128
- runner: windows-2022
129129
arch: amd64
@@ -149,7 +149,7 @@ jobs:
149149
run: scoop install main/cmake@4.0.1 main/ninja
150150
- name: Build
151151
run: |
152-
& 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }}
152+
& 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }}
153153
cmake --preset=ci-msvc -B build -DCMAKE_BUILD_TYPE=Debug .
154154
cmake --build build -j $env:MAKE_JOB_COUNT -v
155155
- name: Test
@@ -163,7 +163,7 @@ jobs:
163163
./datadog-ci.exe junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp report.xml
164164
165165
coverage:
166-
needs: build-linux-cmake
166+
needs: build-linux-cmake
167167
runs-on: ubuntu-22.04-arm
168168
container:
169169
image: datadog/docker-library:dd-trace-cpp-ci-23768e9-arm64
@@ -172,25 +172,24 @@ jobs:
172172
permissions:
173173
contents: read
174174
packages: read
175-
env:
176-
DD_API_KEY: ${{ secrets.DD_CI_VIS_API_KEY }}
177175
steps:
178176
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
179177
- run: bin/test --coverage --verbose
180-
- name: Report Datadog coverage
181-
run: |
182-
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-arm64" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci
183-
cd .coverage
184-
cp filtered.info lcov.info
185-
datadog-ci coverage upload lcov.info
178+
- name: Upload code coverage report to Datadog
179+
# See https://github.com/DataDog/coverage-upload-github-action/releases
180+
uses: DataDog/coverage-upload-github-action@2ba057033351887422f8eb0203d1990c3acbc8c5 # v1.0.4
181+
with:
182+
api_key: ${{ secrets.DD_CI_VIS_API_KEY }}
183+
files: .coverage/filtered.info
184+
format: lcov
186185

187186
build-system-tests-artifact:
188187
runs-on: ubuntu-22.04
189188
steps:
190-
- run: mkdir binaries
189+
- run: mkdir binaries
191190
- run: echo "https://github.com/DataDog/dd-trace-cpp@${BRANCH_NAME}" > binaries/cpp-load-from-git
192191
env:
193-
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
192+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
194193
- name: Save artifact
195194
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
196195
with:

0 commit comments

Comments
 (0)