Skip to content

Commit 331fd49

Browse files
Simplify coverage build to single step
1 parent 1992b6f commit 331fd49

File tree

3 files changed

+33
-96
lines changed

3 files changed

+33
-96
lines changed

.github/workflows/generate_coverage.yaml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Generate coverage and push to Coveralls.io
1212

1313
runs-on: ubuntu-latest
14-
timeout-minutes: 180
14+
timeout-minutes: 150
1515

1616
permissions:
1717
# Needed to cancel any previous runs that are not completed for a given workflow
@@ -117,44 +117,24 @@ jobs:
117117
mamba info
118118
mamba list
119119
120-
- name: Build dpnp tensor with coverage
121-
id: build_tensor
120+
- name: Build dpnp with coverage
121+
id: build_coverage
122122
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
123-
env:
124-
SYCL_CACHE_PERSISTENT: 1
125-
CMAKE_BUILD_PARALLEL_LEVEL: 2
126123
with:
127124
shell: bash
128-
timeout_minutes: 90
125+
timeout_minutes: 120
129126
max_attempts: 5
130127
retry_on: error
131128
command: |
132129
. $CONDA/etc/profile.d/conda.sh
133130
conda activate coverage
134131
[ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh
135132
git clean -fxd
136-
python scripts/gen_coverage.py --build-step tensor
137-
138-
- name: Build dpnp with coverage (skip tensor)
139-
id: build_skip_tensor
140-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
141-
env:
142-
SYCL_CACHE_PERSISTENT: 1
143-
with:
144-
shell: bash
145-
timeout_minutes: 90
146-
max_attempts: 5
147-
retry_on: error
148-
command: |
149-
. $CONDA/etc/profile.d/conda.sh
150-
conda activate coverage
151-
[ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh
152-
python scripts/gen_coverage.py --build-step skip-tensor
133+
python scripts/gen_coverage.py
153134
154135
- name: Total number of coverage attempts
155136
run: |
156-
echo "Total tensor build attempts: ${{ steps.build_tensor.outputs.total_attempts }}"
157-
echo "Total skip-tensor build attempts: ${{ steps.build_skip_tensor.outputs.total_attempts }}"
137+
echo "Total number of coverage attempts: ${{ steps.build_coverage.outputs.total_attempts }}"
158138
159139
- name: Upload coverage data to coveralls.io
160140
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7

dpnp/CMakeLists.txt

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -174,31 +174,18 @@ function(build_dpnp_cython_ext_with_backend _trgt _src _dest)
174174
target_link_libraries(${_trgt} PRIVATE dpnp_backend_library)
175175
endfunction()
176176

177-
# Control which components to build (for memory-constrained CI builds)
178-
# DPNP_BUILD_COMPONENTS:
179-
# ALL (default),
180-
# TENSOR_ONLY,
181-
# SKIP_TENSOR,
182-
if(NOT DEFINED DPNP_BUILD_COMPONENTS)
183-
set(DPNP_BUILD_COMPONENTS "ALL")
184-
endif()
185-
186-
if(DPNP_BUILD_COMPONENTS STREQUAL "ALL" OR DPNP_BUILD_COMPONENTS STREQUAL "TENSOR_ONLY")
187-
add_subdirectory(tensor)
188-
endif()
189-
190-
if(DPNP_BUILD_COMPONENTS STREQUAL "ALL" OR DPNP_BUILD_COMPONENTS STREQUAL "SKIP_TENSOR")
191-
add_subdirectory(backend)
192-
add_subdirectory(backend/extensions/blas)
193-
add_subdirectory(backend/extensions/fft)
194-
add_subdirectory(backend/extensions/indexing)
195-
add_subdirectory(backend/extensions/lapack)
196-
add_subdirectory(backend/extensions/statistics)
197-
add_subdirectory(backend/extensions/ufunc)
198-
add_subdirectory(backend/extensions/vm)
199-
add_subdirectory(backend/extensions/window)
200-
201-
add_subdirectory(dpnp_algo)
202-
add_subdirectory(dpnp_utils)
203-
add_subdirectory(random)
204-
endif()
177+
add_subdirectory(tensor)
178+
179+
add_subdirectory(backend)
180+
add_subdirectory(backend/extensions/blas)
181+
add_subdirectory(backend/extensions/fft)
182+
add_subdirectory(backend/extensions/indexing)
183+
add_subdirectory(backend/extensions/lapack)
184+
add_subdirectory(backend/extensions/statistics)
185+
add_subdirectory(backend/extensions/ufunc)
186+
add_subdirectory(backend/extensions/vm)
187+
add_subdirectory(backend/extensions/window)
188+
189+
add_subdirectory(dpnp_algo)
190+
add_subdirectory(dpnp_utils)
191+
add_subdirectory(random)

scripts/gen_coverage.py

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,6 @@ def parse_args():
119119
action="store_true",
120120
help="Remove build dir before rebuild (default: False)",
121121
)
122-
p.add_argument(
123-
"--build-step",
124-
choices=["tensor", "skip-tensor", "both"],
125-
default="both",
126-
help="Which build step to run: tensor (only tensor to generate headers), "
127-
"skip-tensor (everything except tensor, assumes tensor headers exist), "
128-
"or both (default: both)",
129-
)
130122

131123
return p.parse_args()
132124

@@ -200,36 +192,17 @@ def main():
200192

201193
log_cmake_args(cmake_args, "gen_coverage")
202194

203-
if args.build_step in ["tensor", "both"]:
204-
# Build tensor only to generate Cython headers
205-
tensor_cmake_args = cmake_args.copy()
206-
tensor_cmake_args.append("-DDPNP_BUILD_COMPONENTS=TENSOR_ONLY")
207-
208-
build_extension(
209-
setup_dir,
210-
env,
211-
tensor_cmake_args,
212-
cmake_executable=args.cmake_executable,
213-
generator=args.generator,
214-
build_type="Coverage",
215-
)
216-
217-
if args.build_step in ["skip-tensor", "both"]:
218-
# Build everything except tensor (assumes tensor headers already exist)
219-
skip_tensor_cmake_args = cmake_args.copy()
220-
skip_tensor_cmake_args.append("-DDPNP_BUILD_COMPONENTS=SKIP_TENSOR")
221-
222-
build_extension(
223-
setup_dir,
224-
env,
225-
skip_tensor_cmake_args,
226-
cmake_executable=args.cmake_executable,
227-
generator=args.generator,
228-
build_type="Coverage",
229-
)
230-
install_editable(setup_dir, env)
195+
build_extension(
196+
setup_dir,
197+
env,
198+
cmake_args,
199+
cmake_executable=args.cmake_executable,
200+
generator=args.generator,
201+
build_type="Coverage",
202+
)
203+
install_editable(setup_dir, env)
231204

232-
if args.run_pytest and args.build_step in ["skip-tensor", "both"]:
205+
if args.run_pytest:
233206
env["LLVM_PROFILE_FILE"] = "dpnp_pytest.profraw"
234207
pytest_cmd = [
235208
"pytest",
@@ -296,13 +269,10 @@ def find_objects():
296269
)
297270

298271
print("[gen_coverage] Coverage export is completed")
299-
elif args.build_step == "tensor":
300-
print(
301-
"[gen_coverage] Skipping pytest (tensor-only build, tests will run after skip-tensor build)"
302-
)
303272
else:
304273
print(
305-
"[gen_coverage] Skipping pytest and coverage collection (--skip-pytest)"
274+
"[gen_coverage] Skipping pytest and coverage collection "
275+
"(--skip-pytest)"
306276
)
307277

308278
print("[gen_coverage] Done")

0 commit comments

Comments
 (0)