Skip to content

Commit

Permalink
Fix issue with Windows build/test steps
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-pavlyk committed Sep 18, 2024
1 parent 826a330 commit 057600e
Showing 1 changed file with 36 additions and 12 deletions.
48 changes: 36 additions & 12 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
path: $CONDA/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2

test:
needs: build
Expand Down Expand Up @@ -128,11 +128,13 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2

- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
conda-build-version: "*"
activate-environment: true
miniforge-variant: Miniforge3
miniforge-version: latest
activate-environment: build
channels: conda-forge
python-version: ${{ matrix.python }}

- name: Cache conda packages
Expand All @@ -146,8 +148,23 @@ jobs:
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
- name: Store conda paths as envs
shell: bash -l {0}
run: |
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> $GITHUB_ENV
- name: Install conda build
run: |
conda activate
conda install -y conda-build
conda list -n base
- name: Build conda package
run: conda build --no-test --python ${{ matrix.python }} -c conda-forge -c https://software.repos.intel.com/python/conda --override-channels conda-recipe-cf
run: |
conda activate
conda build --no-test --python ${{ matrix.python }} -c conda-forge -c https://software.repos.intel.com/python/conda --override-channels conda-recipe-cf
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -175,27 +192,32 @@ jobs:
uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
conda-build-version: '*'
miniconda-version: 'latest'
activate-environment: mkl_umath_test
miniforge-variant: Miniforge3
miniforge-version: latest
activate-environment: build
channels: conda-forge
python-version: ${{ matrix.python }}

- name: Create conda channel with the artifact bit
shell: cmd /C CALL {0}
run: |
echo ${{ env.workdir }}
mkdir ${{ env.workdir }}\channel\win-64
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
dir ${{ env.workdir }}\channel\win-64
- name: Index the channel
shell: cmd /C CALL {0}
run: conda index ${{ env.workdir }}\channel
run: |
conda activate
conda index ${{ env.workdir }}\channel
- name: Dump mkl_umath version info from created channel into ver.json
shell: cmd /C CALL {0}
run: |
conda activate
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
- name: Output content of produced ver.json
shell: pwsh
Expand All @@ -210,6 +232,7 @@ jobs:
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
SET PACKAGE_VERSION=%%F
)
conda activate
conda install -n mkl_umath_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
- name: Display lockfile content
shell: pwsh
Expand Down Expand Up @@ -241,6 +264,7 @@ jobs:
- name: Report content of test environment
shell: cmd /C CALL {0}
run: |
conda activate
echo "Value of CONDA enviroment variable was: " %CONDA%
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
conda info && conda list -n mkl_umath_test
Expand Down

0 comments on commit 057600e

Please sign in to comment.