Skip to content

Commit

Permalink
Use conda build over mambabuild
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzEeKkAa committed May 1, 2024
1 parent 26f0ceb commit de347df
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ on:
env:
PACKAGE_NAME: dpbench
MODULE_NAME: dpbench
# There is a separate action that removes defaults.
CHANNELS: 'dppy/label/dev,conda-forge,intel,nodefaults'
VER_JSON_NAME: 'version.json'
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
VER_SCRIPT2: "d = j['dpbench'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
Expand Down Expand Up @@ -54,38 +52,37 @@ jobs:
with:
fetch-depth: 0

- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
- name: Setup conda-build
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python }}
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: "build"
channels: ${{ env.CHANNELS }}
auto-activate-base: true
activate-environment: ""
channel-priority: "disabled"
run-post: false

- name: Disable defautls
run: conda config --remove channels defaults

- name: Store conda paths as envs
shell: bash -l {0}
run: |
echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/${{ runner.os == 'Linux' && 'linux' || 'win' }}-64/" | tr "\\" '/' >> $GITHUB_ENV
echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV
# boa is an extention to conda so we can use mamba resolver in conda build
- name: Install conda-build
run: mamba install boa
run: conda install conda-build

- name: Configure MSBuild
if: runner.os == 'Windows'
uses: microsoft/[email protected]
with:
vs-version: '14.35'

- name: Set conda channels
run: |
conda config --append channels dppy/label/dev
conda config --append channels conda-forge
conda config --append channels nodefaults
conda config --remove channels defaults
- name: Build conda package
run: conda mambabuild --no-test --python ${{ matrix.python }} conda-recipe
run: conda build --python ${{ matrix.python }} conda-recipe

- name: Upload artifact
uses: actions/[email protected]
Expand Down Expand Up @@ -121,19 +118,20 @@ jobs:
continue-on-error: ${{ matrix.experimental }}

steps:
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
- name: Setup conda-build
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python }}
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: "build"
channels: ${{ env.CHANNELS }}
activate-environment: ""
auto-activate-base: true
channel-priority: "disabled"
run-post: false

- name: Disable defautls
run: conda config --remove channels defaults
- name: Set conda channels
run: |
conda config --append channels dppy/label/dev
conda config --append channels conda-forge
conda config --append channels nodefaults
conda config --remove channels defaults
- name: Store conda paths as envs
shell: bash -l {0}
Expand All @@ -159,7 +157,7 @@ jobs:
# Needed to be able to run conda index
- name: Install conda-build
run: mamba install conda-build conda-index
run: conda install conda-build conda-index

- name: Create conda channel
run: python -m conda_index ${{ env.CHANNEL_PATH }}
Expand All @@ -170,7 +168,7 @@ jobs:
cat ${{ env.VER_JSON_PATH }}
- name: Install dpbench
run: mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest intel::intel-opencl-rt python=${{ matrix.python }} -c ${{ env.CHANNEL_PATH }}
run: conda install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest intel::intel-opencl-rt python=${{ matrix.python }} -c ${{ env.CHANNEL_PATH }}

- name: Setup OpenCL CPU device
if: runner.os == 'Windows'
Expand Down

0 comments on commit de347df

Please sign in to comment.