Skip to content

change ci from conda to mamba #104

change ci from conda to mamba

change ci from conda to mamba #104

Workflow file for this run

# This workflow will install Python dependencies using mamba, run tests and check pre-commit
name: Python package
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10","3.11"]
steps:
- uses: actions/checkout@v3
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash
generate-run-shell: true
environment-name: testenv
create-args: >-
python=${{ matrix.python-version }}
- name: Install dependencies in mamba testenv
run: |
micromamba update -n testenv -f environment.yml
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# $CONDA/bin/conda env update --file environment.yml --name base
# - name: Lint with flake8
# run: |
# $CONDA/bin/conda install flake8
# # stop the build if there are Python syntax errors or undefined names
# $CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# $CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run pytest in micromamba environment
run: |
micromamba install -n testenv pytest
micromamba run -n testenv pytest --import-mode=importlib .
# shell: micromamba-shell {0}
# - name: Test with pytest
# run: |
# $CONDA/bin/conda install conda-build
# $CONDA/bin/conda develop ./src
# $CONDA/bin/conda install pytest
# $CONDA/bin/pytest --import-mode=importlib .
- name: pre-commit
uses: pre-commit/action@v3.0.0
# eval "$(micromamba shell hook --shell bash)"
# micromamba activate testenv