Skip to content

Add conda package build and publishing pipeline #3

Add conda package build and publishing pipeline

Add conda package build and publishing pipeline #3

name: Unit testing with Conda
on:
workflow_dispatch:
schedule:
- cron: '30 23 * * SUN'
pull_request:
types: [opened, reopened, synchronize]
jobs:
setup-conda:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ${{ github.event_name == 'schedule' && fromJson('["3.8", "3.9", "3.10", "3.11", "3.12"]') || fromJson('["3.12"]') }}
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: flexible
show-channel-urls: true
- name: Display conda info
run: |
conda info
conda list
conda config --show-sources
conda config --show
- name: Install pyproject2conda
run: |
conda install -c conda-forge pyproject2conda -y
- name: Convert pyproject to environment.yml
run: |
pyproject2conda yaml -e test --python-include python=${{ matrix.python-version }} > environment.yml
- name: Install dependencies from environment.yml
run: |
conda env update --file environment.yml --name test
rm environment.yml
- name: Run unit tests
run: pytest