Pin torch version and add debug for conda-build channels #19
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Package using Conda | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' # Trigger on tags like v0.1.0 | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Conda with Python 3.10 | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: '3.10' | |
auto-update-conda: true | |
environment-file: environment.yml | |
activate-environment: deeptaxa_env | |
channels: pytorch,conda-forge,defaults | |
- name: Install DeepTaxa and test dependencies | |
shell: bash -l {0} | |
run: | | |
pip install . # Install DeepTaxa from source | |
conda install flake8 pytest -y | |
- name: Lint with flake8 | |
shell: bash -l {0} | |
run: | | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest | |
shell: bash -l {0} | |
run: | | |
pytest tests/ -v | |
build-and-release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: build-and-test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Conda with Python 3.10 | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: '3.10' | |
auto-update-conda: true | |
channels: pytorch,conda-forge,defaults | |
activate-environment: build_env | |
- name: Install Conda Build Tools | |
shell: bash -l {0} | |
run: | | |
conda install conda-build anaconda-client -c conda-forge -y | |
- name: Debug Channel Configuration | |
shell: bash -l {0} | |
run: | | |
conda config --show channels | |
conda config --add channels pytorch | |
conda config --add channels conda-forge | |
conda config --add channels defaults | |
conda config --show channels # Verify channels | |
- name: Build Conda Package | |
shell: bash -l {0} | |
run: | | |
conda-build conda-recipe/ --output-folder ./conda-bld --channel pytorch --channel conda-forge --channel defaults --override-channels | |
ls -l ./conda-bld/noarch/ || ls -l ./conda-bld/linux-64/ # Debug: Show built files | |
- name: Upload to Anaconda.org | |
shell: bash -l {0} | |
run: | | |
echo "Uploading files:" | |
ls -l ./conda-bld/noarch/ || ls -l ./conda-bld/linux-64/ # Debug: List files | |
anaconda upload --user systems-genomics-lab ./conda-bld/noarch/deeptaxa-*.tar.bz2 || anaconda upload --user systems-genomics-lab ./conda-bld/linux-64/deeptaxa-*.tar.bz2 | |
echo "Upload completed" | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |