change ci from conda to mamba #92
Workflow file for this run
This file contains 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
# 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: | |
environment-name: test-env | |
create-args: >- | |
python=${{ matrix.python-version }} | |
- name: Install dependencies in mamba test-env | |
run: | | |
micromamba update -n test-env -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 activate test-env | |
micromamba install pytest | |
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 |