-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (142 loc) · 7 KB
/
qiita-plugin-ci.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# name: Qiita Plugin CI
on:
push:
branches: [ dev ]
pull_request:
jobs:
# derived from https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml
main:
runs-on: ubuntu-latest
services:
postgres:
# Docker Hub image
image: postgres:13.4
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
COVER_PACKAGE: ${{ matrix.cover_package }}
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# based on https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml#L44-L72
- 5432/tcp
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Setup for conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.9
- name: Basic dependencies install
env:
COVER_PACKAGE: ${{ matrix.cover_package }}
shell: bash -l {0}
run: |
echo "Testing: " $COVER_PACKAGE
# we need to download qiita directly so we have "easy" access to
# all config files
wget https://github.com/biocore/qiita/archive/dev.zip
unzip dev.zip
# pull out the port so we can modify the configuration file easily
pgport=${{ job.services.postgres.ports[5432] }}
sed -i "s/PORT = 5432/PORT = $pgport/" qiita-dev/qiita_core/support_files/config_test.cfg
# PGPASSWORD is read by pg_restore, which is called by the build_db process.
export PGPASSWORD=postgres
# Setting up main qiita conda environment
conda config --add channels conda-forge
conda create -q --yes -n qiita python=3.9 libgfortran numpy nginx cython redis
conda activate qiita
- name: Qiita install
shell: bash -l {0}
run: |
conda activate qiita
pip --quiet install qiita-dev/ --no-binary redbiom
mkdir ~/.qiita_plugins
- name: Install Qiita plugins
shell: bash -l {0}
run: |
conda config --add channels bioconda
conda create --yes -n qp-woltka python=3.9 biom-format bowtie2
conda activate qp-woltka
# bowtie2==2.5.0 is what's installed in main qiita so making sure we keep
# using the same version for consistency; note that we will need to force
conda install --yes -c bioconda bowtie2==2.5.0
pip --quiet install .
pip --quiet install -U pip pip nose flake8
pip --quiet install https://github.com/qiita-spots/qiita_client/archive/master.zip
export QIITA_ROOTCA_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/
export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA
for file in $(ls $QC_WOLTKA_DB_DP); do tar xvzf $QC_WOLTKA_DB_DP$file -C $QC_WOLTKA_DB_DP; done
woltka_version=`woltka --version`
bowtie2_version=`bowtie2 --version`
if [[ $woltka_version != *"0.1.6"* ]]; then echo "wrong woltka version", $woltka_version; exit 1; fi
if [[ $bowtie2_version != *"2.5.0"* ]]; then echo "wrong bowtie2 version", $bowtie2_version; exit 1; fi
export ENVIRONMENT="source /home/runner/.profile; conda activate qp-woltka; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA"
configure_woltka --env-script 'source /home/runner/.profile; conda activate qp-woltka; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA; export ENVIRONMENT="source /home/runner/.profile; conda activate qp-woltka; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA"' --ca-cert $QIITA_ROOTCA_CERT
echo "Available Qiita plugins"
ls ~/.qiita_plugins/
- name: Starting Main Services
shell: bash -l {0}
run: |
conda activate qiita
export QIITA_ROOTCA_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
sed "s#/home/runner/work/qiita/qiita#${PWD}/qiita-dev/#g" `pwd`/qiita-dev/qiita_core/support_files/config_test.cfg > ${QIITA_CONFIG_FP}
export REDBIOM_HOST="http://localhost:7379"
echo "1. Setting up redis"
redis-server --daemonize yes --port 7777
echo "2. Setting up nginx"
mkdir -p ${CONDA_PREFIX}/var/run/nginx/
export NGINX_FILE=`pwd`/qiita-dev/qiita_pet/nginx_example.conf
export NGINX_FILE_NEW=`pwd`/qiita-dev/qiita_pet/nginx_example_local.conf
sed "s#/home/runner/work/qiita/qiita#${PWD}/qiita-dev/#g" ${NGINX_FILE} > ${NGINX_FILE_NEW}
nginx -c ${NGINX_FILE_NEW}
echo "3. Setting up qiita"
qiita-env make --no-load-ontologies
qiita plugins update
qiita-test-install
echo "4. Starting supervisord => multiple qiita instances"
supervisord -c ${PWD}/qiita-dev/qiita_pet/supervisor_example.conf
sleep 10
cat /tmp/supervisord.log
- name: Main tests
shell: bash -l {0}
env:
COVER_PACKAGE: ${{ matrix.cover_package }}
run: |
conda activate qp-woltka
export QIITA_ROOTCA_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
export ENVIRONMENT="source /home/runner/.profile; conda activate qp-woltka; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA"
export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/
export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA
export PYTHONWARNINGS="ignore:Certificate for localhost has no \`subjectAltName\`"
nosetests --with-doctest --with-coverage -v --cover-package=qp_woltka
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: codecov.yml
lint:
runs-on: ubuntu-latest
steps:
- name: flake8
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: install dependencies
run: python -m pip install --upgrade pip
- name: Check out repository code
uses: actions/checkout@v2
- name: lint
run: |
pip --quiet install -q flake8
flake8 qp_woltka setup.py scripts/*