From db6a3c71a7b30b0a07ac5bc2777f58513a75e42f Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Fri, 16 Oct 2026 15:32:34 +0200 Subject: [PATCH] Fix Windows test steps that never ran and the Windows conda cache path The Windows test jobs in conda-package.yml and conda-package-cf.yml run their steps with `cmd /C CALL {0}` and invoked `conda activate` without CALL. conda is a batch file, and running a batch file from another one without CALL never returns, so everything after it in the step was skipped: the smoke test and pytest never ran, and the steps still passed. Prefix the conda calls in those steps with CALL. The Windows build and test jobs also cached /home/runner/conda_pkgs_dir, which does not exist on Windows runners, so the cache was never saved. Point it at ~/conda_pkgs_dir, where setup-miniconda keeps packages. --- .github/workflows/conda-package-cf.yml | 12 ++++++------ .github/workflows/conda-package.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/conda-package-cf.yml b/.github/workflows/conda-package-cf.yml index 04c68592..4b931393 100644 --- a/.github/workflows/conda-package-cf.yml +++ b/.github/workflows/conda-package-cf.yml @@ -265,7 +265,7 @@ jobs: env: CACHE_NUMBER: 3 # Increase to reset cache with: - path: /home/runner/conda_pkgs_dir + path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_tag || matrix.python }}-${{hashFiles('**/meta.yaml') }} restore-keys: | @@ -411,7 +411,7 @@ jobs: env: CACHE_NUMBER: 0 # Increase to reset cache with: - path: /home/runner/conda_pkgs_dir + path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_tag || matrix.python }}-${{hashFiles('lockfile') }} restore-keys: | @@ -435,20 +435,20 @@ jobs: - name: Report content of test environment shell: cmd /C CALL {0} run: | - conda activate + CALL conda activate echo "Value of CONDA environment variable was: " %CONDA% echo "Value of CONDA_PREFIX environment variable was: " %CONDA_PREFIX% - conda info && conda list -n ${{ env.TEST_ENV_NAME }} + CALL conda info && CALL conda list -n ${{ env.TEST_ENV_NAME }} - name: Smoke test shell: cmd /C CALL {0} run: | @ECHO ON - conda activate ${{ env.TEST_ENV_NAME }} + CALL conda activate ${{ env.TEST_ENV_NAME }} python -c "import mkl_umath, numpy as np; mkl_umath.patch_numpy_umath(); np.sin(np.linspace(0, 1, num=10**6));" - name: Run tests shell: cmd /C CALL {0} run: | - conda activate ${{ env.TEST_ENV_NAME }} + CALL conda activate ${{ env.TEST_ENV_NAME }} python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }} diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 39152e91..53e1f3b4 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -275,7 +275,7 @@ jobs: env: CACHE_NUMBER: 3 # Increase to reset cache with: - path: /home/runner/conda_pkgs_dir + path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_tag || matrix.python }}-${{hashFiles('**/meta.yaml') }} restore-keys: | @@ -428,7 +428,7 @@ jobs: env: CACHE_NUMBER: 0 # Increase to reset cache with: - path: /home/runner/conda_pkgs_dir + path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_tag || matrix.python }}-${{hashFiles('lockfile') }} restore-keys: | @@ -456,20 +456,20 @@ jobs: - name: Report content of test environment shell: cmd /C CALL {0} run: | - conda activate + CALL conda activate echo "Value of CONDA environment variable was: " %CONDA% echo "Value of CONDA_PREFIX environment variable was: " %CONDA_PREFIX% - conda info && conda list -n ${{ env.TEST_ENV_NAME }} + CALL conda info && CALL conda list -n ${{ env.TEST_ENV_NAME }} - name: Smoke test shell: cmd /C CALL {0} run: | @ECHO ON - conda activate ${{ env.TEST_ENV_NAME }} + CALL conda activate ${{ env.TEST_ENV_NAME }} python -c "import mkl_umath, numpy as np; mkl_umath.patch_numpy_umath(); np.sin(np.linspace(0, 1, num=10**6));" - name: Run tests shell: cmd /C CALL {0} run: | - conda activate ${{ env.TEST_ENV_NAME }} + CALL conda activate ${{ env.TEST_ENV_NAME }} python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }}