Skip to content

Commit

Permalink
Merge pull request #43 from pnnl/ci-fixes
Browse files Browse the repository at this point in the history
Update continuous integration to use rattler-build
  • Loading branch information
smcolby authored Dec 19, 2024
2 parents ba9f129 + 765e1c5 commit bfe68e7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 45 deletions.
60 changes: 29 additions & 31 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-variant: miniforge3
miniforge-version: latest
use-mamba: true
environment-file: envs/linux.yml
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Setup environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-variant: miniforge3
miniforge-version: latest
use-mamba: true
environment-file: envs/osx.yml
Expand All @@ -82,46 +82,44 @@ jobs:
# pytest
Deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- Test_Linux
- Test_Mac
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target-platform: linux-64
- os: macos-latest
target-platform: osx-arm64
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
python-version: 3.12
channels: conda-forge,bioconda,smcolby
use-only-tar-bz2: false
auto-activate-base: true

- name: Install dependencies
run: |
mamba install boa anaconda-client conda-verify conda-build

- name: Build conda package
run: |
mkdir build/
conda mambabuild conda-recipe/ --output-folder build/
conda index build/
- name: Convert to osx-arm64
run: conda convert -p osx-arm64 build/linux-64/*.tar.bz2 -o build/

- name: Upload packages
uses: prefix-dev/rattler-build-action@v0.2.24
with:
# Needs to be unique for each matrix entry
artifact-name: isicle-${{ matrix.target-platform }}
build-args: |
--target-platform ${{ matrix.target-platform }}
--recipe rattler-recipe/recipe.yaml
--variant-config rattler-recipe/variants.yaml
--output-dir build/
-c conda-forge
-c bioconda
- name: Upload conda package
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
anaconda upload build/linux-64/*.tar.bz2
anaconda upload build/osx-arm64/*.tar.bz2
for pkg in $(find build/ -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do
echo "Uploading ${pkg}"
rattler-build upload anaconda --owner smcolby "${pkg}"
done
6 changes: 0 additions & 6 deletions conda-recipe/conda_build_config.yaml

This file was deleted.

13 changes: 5 additions & 8 deletions conda-recipe/meta.yaml → rattler-recipe/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% set data = load_setup_py_data(setup_file="../setup.py",
from_recipe_dir=True) %}
context:
version: "2.0.0" # TODO: obtain this from package directly

package:
name: isicle
version: {{ data.get("version") }}
version: ${{ version }}

source:
path: ..
Expand All @@ -17,7 +17,8 @@ extra:

build:
number: 0
script: "{{ PYTHON }} -m pip install -vv --no-deps ."
script:
- python -m pip install -vv --no-deps .

requirements:
host:
Expand All @@ -37,7 +38,3 @@ requirements:
- snakemake >=6.3.0
- statsmodels >=0.11.1
- xtb >=6.5.1

test:
imports:
- isicle
6 changes: 6 additions & 0 deletions rattler-recipe/variants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"

0 comments on commit bfe68e7

Please sign in to comment.