Skip to content

Refactor morphMan

Refactor morphMan #2

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
strategy:
matrix:
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/morphman
- os: macos-latest
label: osx-64
prefix: /Users/runner/miniconda3/envs/morphman
name: Test morphMan on ${{ matrix.label }}
runs-on: ${{ matrix.os }}
defaults:
run: # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Setup and install with Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
channels: conda-forge
activate-environment: morphman
use-mamba: true
environment-file: environment.yml
id: mamba
- 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