Skip to content

Commit 1c375af

Browse files
authored
Add a work-flow to run nightly tests (#2190)
1 parent b839c40 commit 1c375af

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/cron-run-tests.yaml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Run tests suite
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
8+
schedule:
9+
- cron: '28 2 * * *'
10+
workflow_dispatch:
11+
12+
permissions: read-all
13+
14+
env:
15+
PACKAGE_NAME: dpnp
16+
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
17+
TEST_ENV_NAME: test
18+
19+
jobs:
20+
test:
21+
name: Test ['${{ matrix.runner }}', python='${{ matrix.python }}']
22+
23+
runs-on: ${{ matrix.runner }}
24+
25+
defaults:
26+
run:
27+
shell: ${{ matrix.runner == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
28+
29+
permissions:
30+
# Needed to cancel any previous runs that are not completed for a given workflow
31+
actions: write
32+
33+
strategy:
34+
matrix:
35+
python: ['3.9', '3.10', '3.11', '3.12']
36+
runner: [ubuntu-22.04, ubuntu-24.04, windows-2019]
37+
38+
continue-on-error: false
39+
40+
steps:
41+
- name: Cancel Previous Runs
42+
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
43+
with:
44+
access_token: ${{ github.token }}
45+
46+
- name: Setup miniconda
47+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
48+
with:
49+
miniforge-version: latest
50+
use-mamba: 'true'
51+
channels: conda-forge
52+
conda-remove-defaults: 'true'
53+
python-version: ${{ matrix.python }}
54+
activate-environment: ${{ env.TEST_ENV_NAME }}
55+
56+
- name: Install dpnp
57+
run: |
58+
mamba install ${{ env.PACKAGE_NAME }} pytest ${{ env.CHANNELS }}
59+
env:
60+
MAMBA_NO_LOW_SPEED_LIMIT: 1
61+
62+
- name: List installed packages
63+
run: mamba list
64+
65+
- name: Activate OCL CPU RT
66+
if: ${{ matrix.runner }} == 'windows-2019'
67+
shell: pwsh
68+
run: |
69+
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
70+
if (Test-Path $script_path) {
71+
&$script_path
72+
} else {
73+
Write-Warning "File $script_path was NOT found!"
74+
}
75+
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
76+
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
77+
Get-Content -Tail 5 -Path $cl_cfg
78+
79+
- name: Smoke test
80+
run: |
81+
python -m dpctl -f
82+
python -c "import dpnp; print(dpnp.__version__)"
83+
84+
- name: Run tests
85+
run: |
86+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
87+
env:
88+
SYCL_CACHE_PERSISTENT: 1

0 commit comments

Comments
 (0)