Skip to content

Refactor morphMan

Refactor morphMan #5

name: morphMan CI
on:
push:
branches:
- master
pull_request:
branches:
- '**'
schedule:
- cron: '0 8 * * *'
env:
CACHE_NUMBER: 1 # Increase to reset cache
jobs:
check-code:
name: Check code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies and project
run: |
python -m pip install --upgrade pip setuptools
python -m pip install '.[test]'
- name: Run linting and checks
run: |
bash linting.sh
test-code:
needs: check-code
name: Test morphMan (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ "ubuntu-latest", "macos-latest" ]
python-version: [ "3.10" ]
defaults:
run: # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,vmtk,defaults
channel-priority: flexible
activate-environment: morphman
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
- run: |
conda info
conda list
conda config --show-sources
conda config --show
- name: Install morphMan
run: |
python -m pip install '.[test]'
# - uses: actions/cache@v3
# with:
# path: ${{ matrix.prefix }}
# key: ${{ matrix.label }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
# restore-keys: ${{ matrix.label }}-${{ env.CACHE_NUMBER }}-
#
# - run: mamba env update -n morphman -f environment.yml
#
# - name: Install morphMan
# run: mamba run -n morphman python -m pip install '.[test]'
#
# - name: Run tests
# run: mamba run -n morphman python -m pytest tests
#
# - name: Upload coverage report to Codecov
# if: matrix.os == 'ubuntu-latest'
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./coverage.xml
# fail_ci_if_error: false
# verbose: true