Skip to content
Prev Previous commit
Next Next commit
Rerun tests in nightly workflow based on condition
  • Loading branch information
antonwolfy committed Jan 10, 2025
commit fb3d2af9501c0c523b080eadbb23d6c5fc9e929f
7 changes: 3 additions & 4 deletions .github/workflows/cron-run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ env:
PACKAGE_NAME: dpnp
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
TEST_ENV_NAME: test
RERUN_TESTS_ON_FAILURE: 'true'
RUN_TESTS_MAX_ATTEMPTS: 2

jobs:
Expand Down Expand Up @@ -94,14 +93,14 @@ jobs:
python -c "import dpnp; print(dpnp.__version__)"

- name: Run tests
if: env.RERUN_TESTS_ON_FAILURE != 'true'
id: run_tests
run: |
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
env:
SYCL_CACHE_PERSISTENT: 1

- name: ReRun tests on Linux
if: env.RERUN_TESTS_ON_FAILURE == 'true' && matrix.runner != 'windows-2019'
if: steps.run_tests.outcome == 'failure' && matrix.runner != 'windows-2019'
id: run_tests_linux
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
Expand All @@ -118,7 +117,7 @@ jobs:
SYCL_CACHE_PERSISTENT: 1

- name: ReRun tests on Windows
if: env.RERUN_TESTS_ON_FAILURE == 'true' && matrix.runner == 'windows-2019'
if: steps.run_tests.outcome == 'failure' && matrix.runner == 'windows-2019'
id: run_tests_win
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
Expand Down