Skip to content

🚧 switch mamba installation #627

🚧 switch mamba installation

🚧 switch mamba installation #627

Workflow file for this run

name: Run unit tests, integration tests, and publish package if tagged
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
release:
types: [published]
schedule:
- cron: '0 2 * * 3,6'
jobs:
run-unit-and-integration-tests-with-conda-install:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest",
#"macos-13",
# "windows-latest" # rrcovNA cannot be build from source on windows-server
]
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
# miniforge-variant: Mambaforge
# miniforge-version: latest
# conda-solver: libmamba
# use-mamba: true
# channels: conda-forge,defaults
python-version: ${{ matrix.python-version }}
# mamba-version: "*"
# channels: conda-forge,defaults
channel-priority: strict
environment-file: snakemake_env.yml
activate-environment: snakemake
auto-activate-base: true
auto-update-conda: true
# - uses: mamba-org/setup-micromamba@v1
# with:
# micromamba-version: 'latest' # any version from https://github.com/mamba-org/micromamba-releases
# environment-file: snakemake_env.yml
# create-args: >-
# python=${{ matrix.python-version }}
# init-shell: >-
# bash
# cache-environment: false
# post-cleanup: 'none'
# - name: inspect-conda-environment
# run: |
# conda info
# conda list
# conda env export --from-history --no-builds > environment.yml
# conda env export --no-builds
# conda env export --no-builds > environment_w_versions.yml
# - name: test-r-kernel-imports
# run: |
# Rscript -e "library(stringi)"
# Rscript -e "library(stringr)"
# Rscript -e "library(reshape2)"
- name: Dry-Run demo workflow (integration test)
run: |
cd project
snakemake -p -c1 --configfile config/single_dev_dataset/example/config.yaml --use-conda -n
- name: Run demo workflow (integration test)
continue-on-error: true
run: |
cd project
snakemake -p -c4 -k --configfile config/single_dev_dataset/example/config.yaml --use-conda
- name: Show current files in conda snakemake folder
run: ls -l project/.snakemake/conda/
- name: Run demo workflow again (in case of installation issues)
continue-on-error: true
run: |
cd project
snakemake -p -c4 -k --configfile config/single_dev_dataset/example/config.yaml --use-conda
- name: Run demo workflow again (in case of installation issues) - one thread
run: |
cd project
snakemake -p -c1 --configfile config/single_dev_dataset/example/config.yaml --use-conda
- name: Archive results
# https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.python-version }}-example-workflow-results
path: |
project/runs/example/
environment.yml
environment_w_versions.yml
run-unit-local-pip-installation:
runs-on: ${{ matrix.os }}
name: test-pip-installation
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest",]
# "macos-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
activate-environment: test
auto-activate-base: true
- name: check conda
run: |
conda info
conda list
conda info -e
which python
conda activate test
which pip
- name: Install build dependencies explicitly
run: |
python -m pip install setuptools_scm
conda list
- name: install pimms
run: python -m pip install .
# - name: install njab
# run: python -m pip install njab
- name: Install pytest
run: pip install pytest pytest-cov
- name: Run pytest
run: pytest .
- name: Install papermill
run: pip install papermill ipykernel
- name: View papermill help message for notebooks (as scripts)
run: |
cd project
papermill 01_0_split_data.ipynb --help-notebook
papermill 01_1_train_VAE.ipynb --help-notebook
papermill 01_1_train_DAE.ipynb --help-notebook
papermill 01_1_train_CF.ipynb --help-notebook
- name: Run tutorial notebooks
run: |
cd project
mkdir runs
papermill 04_1_train_pimms_models.ipynb runs/04_1_train_pimms_models.ipynb
papermill 04_1_train_pimms_models.ipynb runs/04_1_train_pimms_models_no_val.ipynb -p sample_splits False
publish:
name: Publish package
if: startsWith(github.ref, 'refs/tags')
needs:
- run-unit-and-integration-tests-with-conda-install
- run-unit-local-pip-installation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install twine and build
run: python -m pip install --upgrade twine build
- name: Build
run: python -m build
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}