-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (123 loc) · 4.28 KB
/
pytest.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python unit & integration tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
with:
path: main
- name: Restore GPS database from cache
uses: actions/cache@v2
with:
path: /home/runner/work/beebop_py/beebop_py/main/storage/GPS_v4_references
key: cache-gps-v4-db
id: cache-db
- name: Download and extract GPS database
working-directory: ./main
run: |
./scripts/download_db --small storage
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
python-version: 3.9
activate-environment: beebop_py
channels: bioconda, conda-forge
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Restore Conda env from cache
uses: actions/cache@v2
with:
path: /usr/share/miniconda/envs/beebop_py
key:
# Refresh cache each day
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER}}
env:
# Increment this value to manually reset cache.
CACHE_NUMBER: 0
id: cache-conda
# - name: Install poppunk
# run: conda install poppunk
# currently the latest poppunk release is missing some functions required for beebop. For now installing from source:
- name: Get poppunk source code
uses: actions/checkout@v3
with:
repository: bacpop/PopPUNK
ref: fix-json-serialisation
path: poppunk
- name: install poppunk & dependencies
working-directory: ./poppunk
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate beebop_py
conda install graph-tool
conda install mandrake
conda install rapidnj
sudo apt-get update
sudo apt-get install libeigen3-dev libegl1
sudo apt-get install libopenblas-dev
sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
pip install joblib==1.1.0
conda install -c bioconda pp-sketchlib=2.0.0
pip3 install git+https://github.com/bacpop/PopPUNK
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install dependencies
working-directory: ./main
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate beebop_py
poetry install
- name: Run Redis
working-directory: ./main
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate beebop_py
docker pull redis
docker run --rm -d --name=redis -p 6379:6379 redis
- name: Test with pytest
env:
MICROREACT_TOKEN: ${{ secrets.MICROREACT_TOKEN }}
working-directory: ./main
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate beebop_py
export PATH="/usr/share/miniconda/bin:$PATH"
rq worker > rq_output.txt 2>&1 &
STORAGE_LOCATION=./tests/results DB_LOCATION=./storage/GPS_v4_references poetry run coverage run -m pytest
- name: Process coverage
working-directory: ./main
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate beebop_py
export PATH="/usr/share/miniconda/bin:$PATH"
poetry run coverage report -m && poetry run coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
with:
root_dir: ./main
# Uncomment the next three lines to debug on failure with
# tmate. However, don't leave them uncommented on merge as that
# causes failing builds to hang forever.
#
# - name: tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3