From a5b82e534acefd2acedcd0d0222d5b60de994d2f Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Fri, 21 Nov 2025 10:26:36 -0600 Subject: [PATCH 1/5] Explicitly request the latest version of miniforge and mamba --- .github/workflows/conda-package.yml | 54 +++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index bf570b0..dc1c785 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -73,11 +73,14 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: conda-incubator/setup-miniconda@v3 + + - uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 with: - conda-remove-defaults: true - auto-activate-base: true - activate-environment: "" + miniforge-version: latest + use-mamba: 'true' + conda-remove-defaults: 'true' + activate-environment: 'build' + python-version: '3.13' # no python 3.14 support by conda-build - name: Cache conda packages uses: actions/cache@v4 @@ -90,17 +93,30 @@ jobs: restore-keys: | ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- + - name: Install conda-build run: conda install conda-build - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + + - name: Store conda paths as envs + shell: bash -el {0} + run: | + echo "CONDA_BLD=$CONDA_PREFIX\\conda-bld\\win-64\\" >> $GITHUB_ENV + echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE\\" >> $GITHUB_ENV + - name: Build conda package run: conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe + - name: Upload artifact uses: actions/upload-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} - path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.conda + path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda + + - name: Upload wheels artifact + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + with: + name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }} + path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_service-*.whl test_linux: needs: build_linux @@ -196,22 +212,28 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} - - uses: conda-incubator/setup-miniconda@v3 + + - uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 with: - conda-remove-defaults: true - auto-activate-base: true - activate-environment: "" - - name: Install conda-build - # Needed to be able to run conda index - run: conda install conda-build + miniforge-version: latest + use-mamba: 'true' + conda-remove-defaults: 'true' + activate-environment: 'test' + python-version: '3.13' # no python 3.14 support by conda-index + + - name: Install conda-index + run: conda install conda-index + - name: Create conda channel run: | mkdir ${{ env.GITHUB_WORKSPACE }}\channel\win-64 move ${{ env.PACKAGE_NAME }}-*.conda ${{ env.GITHUB_WORKSPACE }}\channel\win-64 - conda index ${{ env.GITHUB_WORKSPACE }}/channel + python -m conda_index ${{ env.GITHUB_WORKSPACE }}/channel + # Test channel conda search ${{ env.PACKAGE_NAME }} -c ${{ env.GITHUB_WORKSPACE }}/channel --override-channels --info --json > ${{ env.GITHUB_WORKSPACE }}\ver.json more ${{ env.GITHUB_WORKSPACE }}\ver.json + - name: Collect dependencies shell: cmd run: | @@ -223,6 +245,7 @@ jobs: ) conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} numpy=${{ matrix.numpy }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile more lockfile + - name: Cache conda packages uses: actions/cache@v4 env: @@ -250,6 +273,7 @@ jobs: conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %WORKAROUND_DEPENDENCIES% pytest python=${{ matrix.python }} numpy=${{ matrix.numpy }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} # Test installed packages conda list + - name: Run tests run: | conda activate -n ${{ env.TEST_ENV_NAME }} From e91d2fef2ecee4ce60062ac9477f229745fc5dc4 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Fri, 21 Nov 2025 10:33:27 -0600 Subject: [PATCH 2/5] Add steps to cancel current run in case of triggering the new one and to build wheels --- .github/workflows/conda-package.yml | 33 +++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index dc1c785..0a2f880 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -21,6 +21,11 @@ jobs: matrix: python: ["3.10", "3.11", "3.12", "3.13"] steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -28,6 +33,7 @@ jobs: - name: Set pkgs_dirs run: | echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc + - name: Cache conda packages uses: actions/cache@v4 env: @@ -42,8 +48,16 @@ jobs: - name: Add conda to system path run: echo $CONDA/bin >> $GITHUB_PATH + - name: Install conda-build run: conda install conda-build + + - name: Store conda paths as envs + shell: bash -el {0} + run: | + echo "CONDA_BLD=/usr/share/miniconda/conda-bld/linux-64/" >> $GITHUB_ENV + echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE/" >> $GITHUB_ENV + - name: Build conda package run: | CHANNELS="-c https://software.repos.intel.com/python/conda -c conda-forge --override-channels" @@ -55,11 +69,18 @@ jobs: $VERSIONS \ $CHANNELS \ conda-recipe + - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} - path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.conda + path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda + + - name: Upload wheels artifact + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + with: + name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }} + path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_service-*.whl build_windows: runs-on: windows-latest @@ -67,9 +88,13 @@ jobs: strategy: matrix: python: ["3.10", "3.11", "3.12", "3.13"] - env: - conda-bld: C:\Miniconda\conda-bld\win-64\ + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v4 with: fetch-depth: 0 From bb3f18e8cdce8716bc8f25247368677890d63406 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Fri, 21 Nov 2025 10:36:34 -0600 Subject: [PATCH 3/5] Add an empty line between steps to unify the file --- .github/workflows/conda-package.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 0a2f880..f4f6a7c 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -17,9 +17,11 @@ env: jobs: build_linux: runs-on: ubuntu-latest + strategy: matrix: python: ["3.10", "3.11", "3.12", "3.13"] + steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 @@ -145,7 +147,9 @@ jobs: test_linux: needs: build_linux + runs-on: ubuntu-latest + strategy: matrix: include: @@ -157,6 +161,7 @@ jobs: numpy: "2.3" - python: "3.13" numpy: "2.3" + env: CHANNELS: -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels @@ -165,10 +170,13 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} + - name: Add conda to system path run: echo $CONDA/bin >> $GITHUB_PATH + - name: Install conda-build run: conda install conda-build + - name: Create conda channel run: | mkdir -p $GITHUB_WORKSPACE/channel/linux-64 @@ -178,6 +186,7 @@ jobs: # Test channel conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels --info --json > $GITHUB_WORKSPACE/ver.json cat ver.json + - name: Collect dependencies run: | . $CONDA/etc/profile.d/conda.sh @@ -185,9 +194,11 @@ jobs: export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}") conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} numpy=${{ matrix.numpy }} $CHANNELS --only-deps --dry-run > lockfile cat lockfile + - name: Set pkgs_dirs run: | echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc + - name: Cache conda packages uses: actions/cache@v4 env: @@ -208,6 +219,7 @@ jobs: conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} numpy=${{ matrix.numpy }} $CHANNELS # Test installed packages conda list + - name: Run tests run: | . $CONDA/etc/profile.d/conda.sh @@ -216,6 +228,7 @@ jobs: test_windows: needs: build_windows + runs-on: windows-latest strategy: @@ -229,6 +242,7 @@ jobs: numpy: "2.3" - python: "3.13" numpy: "2.3" + env: CHANNELS: -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels From a8400df1e2c9623f63fc5f214cbb5dabe2ce217a Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Fri, 21 Nov 2025 11:15:23 -0600 Subject: [PATCH 4/5] Fix a typo in wheel package name --- .github/workflows/conda-package.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index f4f6a7c..db197d6 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -82,7 +82,7 @@ jobs: uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }} - path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_service-*.whl + path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_random-*.whl build_windows: runs-on: windows-latest @@ -143,7 +143,7 @@ jobs: uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }} - path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_service-*.whl + path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_random-*.whl test_linux: needs: build_linux @@ -217,6 +217,8 @@ jobs: CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}" export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}") conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} numpy=${{ matrix.numpy }} $CHANNELS + conda activate ${{ env.TEST_ENV_NAME }} + # Test installed packages conda list @@ -310,6 +312,8 @@ jobs: ) SET "WORKAROUND_DEPENDENCIES=intel-openmp" conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %WORKAROUND_DEPENDENCIES% pytest python=${{ matrix.python }} numpy=${{ matrix.numpy }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} + conda activate -n ${{ env.TEST_ENV_NAME }} + # Test installed packages conda list From 983ff5f08ed85009c3a974f578cb906892766891 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Fri, 21 Nov 2025 11:48:49 -0600 Subject: [PATCH 5/5] Remove building the wheels since the w/f is not ready for that --- .github/workflows/conda-package.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index db197d6..c1384d7 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -58,7 +58,6 @@ jobs: shell: bash -el {0} run: | echo "CONDA_BLD=/usr/share/miniconda/conda-bld/linux-64/" >> $GITHUB_ENV - echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE/" >> $GITHUB_ENV - name: Build conda package run: | @@ -78,12 +77,6 @@ jobs: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda - - name: Upload wheels artifact - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 - with: - name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }} - path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_random-*.whl - build_windows: runs-on: windows-latest @@ -128,7 +121,6 @@ jobs: shell: bash -el {0} run: | echo "CONDA_BLD=$CONDA_PREFIX\\conda-bld\\win-64\\" >> $GITHUB_ENV - echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE\\" >> $GITHUB_ENV - name: Build conda package run: conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe @@ -139,12 +131,6 @@ jobs: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda - - name: Upload wheels artifact - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 - with: - name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }} - path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_random-*.whl - test_linux: needs: build_linux