-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (38 loc) · 1.74 KB
/
python.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Based on
# https://github.com/fedarko/strainFlye/blob/main/.github/workflows/main.yml
name: MgSc Python CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# Gotta specify 3.10 as a string to avoid it being converted to 3.1:
# https://github.com/actions/setup-python/issues/160,
# https://github.com/fedarko/pyfastg/blob/master/.github/workflows/main.yml
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
steps:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
- name: Check out code
uses: actions/checkout@v3
# https://github.com/conda-incubator/setup-miniconda#example-3-other-options
- name: Install conda dependencies
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: mgsc
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
- name: Install MetagenomeScope (and its pip dependencies)
run: conda run -n mgsc pip install -e .[dev]
# I think later versions of black (e.g. 23.1) changed things in ways that
# will cause this to fail. Since not all black versions support all
# python versions, the easiest solution is to just only do stylechecking
# when we're working with python 3.6.
# See https://stackoverflow.com/q/73598359 re: "if" expressions here.
- name: Lint and stylecheck the Python code
if: ${{ matrix.python-version == 3.6 }}
run: conda run -n mgsc make pystylecheck
- name: Run Python tests
run: conda run -n mgsc make pytest
- name: Upload Python code coverage information to Codecov
uses: codecov/codecov-action@v2