@@ -147,3 +147,74 @@ jobs:
147147
148148 - name : Test
149149 run : ctest --test-dir "build/${{ matrix.build_type }}" --output-on-failure -R '^(UnitTests|SYCL\.Example)$'
150+
151+ codecov-sycl :
152+ name : codecov sycl
153+ needs : prepare-sycl-toolchain
154+ runs-on : ubuntu-latest
155+ timeout-minutes : 180
156+ steps :
157+ - uses : actions/checkout@v4
158+ with :
159+ submodules : true
160+
161+ - name : Setup ccache
162+ uses : hendrikmuhs/ccache-action@v1.2
163+ with :
164+ key : ccache-${{ github.job }}-linux-x86_64
165+ max-size : 4G
166+
167+ - name : Restore AdaptiveCpp toolchain cache
168+ uses : actions/cache/restore@v4
169+ with :
170+ path : |
171+ ${{ runner.temp }}/AdaptiveCpp
172+ ${{ runner.temp }}/AdaptiveCpp-build
173+ ${{ runner.temp }}/adaptivecpp-install
174+ ${{ runner.temp }}/archives
175+ key : sycl-toolchain-linux-x86_64-${{ env.ADAPTIVECPP_TAG }}-${{ env.ADAPTIVECPP_CACHE_VERSION }}
176+ fail-on-cache-miss : true
177+
178+ - name : Setup SYCL toolchain
179+ uses : ./.github/actions/setup-sycl-toolchain
180+ with :
181+ phase : build
182+
183+ - name : Install coverage tools
184+ shell : bash
185+ run : sudo apt-get update && sudo apt-get install -y gcovr
186+
187+ - name : Configure
188+ shell : bash
189+ run : |
190+ cmake -S . -B build/sycl-coverage -G Ninja \
191+ -DCMAKE_BUILD_TYPE=Debug \
192+ -DCMAKE_C_COMPILER="${ITLABAI_CC}" \
193+ -DCMAKE_CXX_COMPILER="${ITLABAI_CXX}" \
194+ -DCMAKE_PREFIX_PATH="${ITLABAI_CMAKE_PREFIX_PATH}" \
195+ -DOpenMP_ROOT="${ITLABAI_OPENMP_ROOT}" \
196+ -DACPP_TARGETS="${ACPP_TARGETS}" \
197+ -DCMAKE_C_FLAGS="--coverage" \
198+ -DCMAKE_CXX_FLAGS="--coverage" \
199+ -DCMAKE_EXE_LINKER_FLAGS="--coverage" \
200+ -DCMAKE_SHARED_LINKER_FLAGS="--coverage" \
201+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
202+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
203+
204+ - name : Build
205+ run : cmake --build build/sycl-coverage --target SYCL_Example run_test --parallel
206+
207+ - name : Test
208+ run : ctest --test-dir build/sycl-coverage --output-on-failure -R '^(UnitTests|SYCL\.Example)$'
209+
210+ - name : Generate SYCL coverage data
211+ run : gcovr -r . --xml -o sycl-coverage.xml --gcov-executable "llvm-cov-18 gcov" --gcov-ignore-parse-errors
212+
213+ - name : Upload SYCL coverage report to Codecov
214+ uses : codecov/codecov-action@v4.0.1
215+ with :
216+ files : sycl-coverage.xml
217+ flags : sycl
218+ fail_ci_if_error : true
219+ token : ${{ secrets.CODECOV_TOKEN }}
220+ slug : embedded-dev-research/ITLabAI
0 commit comments