Skip to content

Commit

Permalink
Fix for windows step of workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-pavlyk committed Oct 11, 2024
1 parent a90d6a8 commit 3bd4258
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 23 deletions.
40 changes: 29 additions & 11 deletions .github/workflows/conda-package-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,23 @@ jobs:
strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
env:
conda-bld: C:\Miniconda\conda-bld\win-64\
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
auto-activate-base: true
conda-build-version: "*"
activate-environment: true
activate-environment: build
python-version: ${{ matrix.python }}
channels: conda-forge,nodefaults

- name: Remove defaults channel
run: conda config --remove channels defaults

- name: Install conda-build
run: conda install -n base conda-build

- name: Cache conda packages
uses: actions/cache@v4
Expand All @@ -150,13 +155,22 @@ jobs:
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
- name: Build conda package with NumPy 2.0
run: conda build --no-test --python ${{ matrix.python }} --numpy 2 -c conda-forge --override-channels conda-recipe-cf
run: |
conda activate
conda build --no-test --python ${{ matrix.python }} --numpy 2 -c conda-forge --override-channels conda-recipe-cf
- name: Store conda paths as envs
shell: bash -l {0}
run: |
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> $GITHUB_ENV
- 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 }}-*.tar.bz2
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2

test_windows:
needs: build_windows
Expand All @@ -180,13 +194,17 @@ jobs:
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python_ver }}

- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
conda-build-version: '*'
miniconda-version: 'latest'
activate-environment: mkl_fft_test
python-version: ${{ matrix.python_ver }}
miniforge-version: latest
activate-environment: build
python-version: ${{ matrix.python }}
channels: conda-forge,nodefaults

- name: Remove defaults channel
run: conda config --remove channels defaults

- name: Create conda channel with the artifact bit
shell: cmd /C CALL {0}
run: |
Expand Down
48 changes: 36 additions & 12 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,24 @@ jobs:
strategy:
matrix:
python: ['3.9', '3.10']
env:
conda-bld: C:\Miniconda\conda-bld\win-64\
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.2.0
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
conda-build-version: "*"
activate-environment: true
miniforge-version: latest
activate-environment: build
python-version: ${{ matrix.python }}
channels: conda-forge

- name: Remove defaults channel
run: conda config --remove channels defaults

- name: Install conda-build
run: |
conda activate
conda install -n base conda-build
- name: Cache conda packages
uses: actions/cache@v4
Expand All @@ -149,13 +155,22 @@ jobs:
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
- 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
run: |
conda activate
conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe
- name: Store conda paths as envs
shell: bash -l {0}
run: |
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> $GITHUB_ENV
- 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 }}-*.tar.bz2
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2

test_windows:
needs: build_windows
Expand All @@ -180,18 +195,27 @@ jobs:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
conda-build-version: '*'
miniconda-version: 'latest'
activate-environment: mkl_fft_test
miniforge-version: latest
activate-environment: build
python-version: ${{ matrix.python }}
channels: conda-forge,nodefaults

- name: Remove defaults channel
run: conda config --remove channels defaults

- name: Create conda channel with the artifact bit
shell: cmd /C CALL {0}
run: |
echo ${{ env.workdir }}
mkdir ${{ env.workdir }}\channel\
mkdir ${{ env.workdir }}\channel\win-64
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
dir ${{ env.workdir }}\channel\win-64
- name: Install conda index
shell: cmd /C CALL {0}
run: conda install conda-index

- name: Index the channel
shell: cmd /C CALL {0}
run: conda index ${{ env.workdir }}\channel
Expand Down

0 comments on commit 3bd4258

Please sign in to comment.