-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (105 loc) · 3.73 KB
/
build-and-test.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on:
push:
schedule:
# At the end of everyday
- cron: "0 0 * * *"
jobs:
build-and-test-package:
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest"]
include:
- os: ubuntu-latest
environment-file: environment.ubuntu.yml
- os: macos-latest
environment-file: environment.osx.yml
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Run formatter
uses: psf/black@stable
if: matrix.os == 'ubuntu-latest'
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Run linter
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install dependencies on ${{ matrix.os }}
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: kipoi-veff2
environment-file: ${{ matrix.environment-file }}
python-version: 3.7
auto-activate-base: false
- name: Install kipoi-veff2
shell: bash -l {0}
run: python -m pip install .
- name: Run CI tests on ${{ matrix.os }}
shell: bash -l {0}
run: pytest -k "not workflow" -s --disable-warnings tests
- name: Run the full workflow on ${{ matrix.os }}
shell: bash -l {0}
run: cd examples && snakemake -j4 && cd ../ && pytest -k "workflow" -s --disable-warnings tests
build-and-test-package-with-minimal-env:
runs-on: ubuntu-latest
container:
image: "centos:7"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install system level dependencies and conda
run: |
yum update -y
yum install -y sudo
yum install -y build-essential libz-dev libcurl3-dev libarchive-dev gcc wget
wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
/usr/bin/bash ~/miniconda.sh -b
rm ~/miniconda.sh
~/miniconda3/bin/conda clean -tipsy
sudo ln -s ~/miniconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh
echo ". ~/miniconda3/etc/profile.d/conda.sh" >> ~/.bashrc
echo "conda activate base" >> ~/.bashrc
- name: Install kipoi-veff2
shell: bash -l {0}
run: |
source ~/.bashrc
conda update -n base conda
conda install -n base conda-libmamba-solver
conda env create -f environment.minimal.linux.yml --experimental-solver=libmamba
conda activate kipoi-veff2
python -m pip install .
- name: Run CI tests on centos and send coverage report to coveralls.io
shell: bash -l {0}
run: |
source ~/.bashrc
conda activate kipoi-veff2
pytest -k "not workflow" -s --disable-warnings tests
testdocker:
strategy:
fail-fast: true
matrix:
dockerimage: ["kipoi/kipoi-veff2:py36", "kipoi/kipoi-veff2:py37"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pull ${{ matrix.dockerimage }}
run: |
docker pull ${{ matrix.dockerimage }}
- name: Test ${{ matrix.dockerimage }}
run: |
docker run -v $PWD:/tmp ${{ matrix.dockerimage }} pytest -s --disable-warnings -k "not workflow" /tmp/tests
docker system prune -af