-
Notifications
You must be signed in to change notification settings - Fork 1
140 lines (105 loc) · 6.44 KB
/
tests.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
name: MMEDs Tests
on: [push
]
jobs:
run-tests-complex:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Set PYTHONPATH
run: echo "PYTHONPATH=." >> $GITHUB_ENV
- name: Install packages
run: pip install -U pip; pip install cryptography; pip install jupyter_client==6.1.12; pip install ipython_genutils==0.2.0; pip install nbconvert==5.6.1; pip install rpy2; pip install ipykernel; pip install pandas==1.2.3; pip install pillow; pip install -U Jinja2==3.0; pip install coverage;
- name: install pandoc
run: sudo apt-get install pandoc;
- name: Start Services
run: sudo systemctl start mysql.service; sudo systemctl start mongod.service;
- name: Mysql Setup
run: mysql -u root -proot < setup.sql
- name: Server data setup
run: mkdir /home/runner/mmeds_server_data; mkdir /home/runner/conda_envs; mkdir -p /home/runner/conda_env_files/pheniqs; mkdir -p /home/runner/.modules/modulefiles; cp -r ./test_files /home/runner/mmeds_server_data/.; cp ./mmeds/resources/mmeds_stats.yaml /home/runner/mmeds_server_data/.; cp -r ./modules/* /home/runner/.modules/modulefiles/.; cp -r ./conda_env_files/* /home/runner/conda_env_files/.; mkdir /home/runner/mmeds_server_data/taxonomic_databases; touch /home/runner/mmeds_server_data/taxonomic_databases/dummy_classifier.qza;
- name: Python install
run: sudo python setup.py install --verbose; pip install wheel; pip install git+https://github.com/clemente-lab/mmeds-meta@$GITHUB_REF_NAME;
#- name: install jupyter
#run: conda env create -f ./conda_env_files/jupyter_env-github.yaml -p /home/runner/conda_envs/jupyter;
- name: add bioconda channel for qiime
run: conda config --append channels conda-forge --append channels bioconda --append channels defaults
- name: install qiime
run: conda env create -f ./conda_env_files/qiime2-2020.8_env.yaml -p /home/runner/conda_envs/qiime2-2020.8
#- name: install R
#run: sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common; sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9; sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'; sudo apt install r-base;
#- name: install R dependencies
#run: sudo Rscript -e 'install.packages("GGally",dependencies=TRUE)'; sudo Rscript -e 'install.packages("ggrepel",dependencies=TRUE)'; sudo Rscript -e 'install.packages("RColorBrewer",dependencies=TRUE)'; sudo Rscript -e 'install.packages("ggplot2",dependencies=TRUE)';
- name: install pheniqs
run: conda env create -f ./conda_env_files/pheniqs_env.yaml -p /home/runner/conda_envs/pheniqs
- name: install latex
run: conda env create -f ./conda_env_files/latex_env.yaml -p /home/runner/conda_envs/latex
- name: Unit Tests
run: |
coverage run --parallel-mode --concurrency=multiprocessing ./mmeds/tests/unit/test.py analysis demultiplex;
- uses: actions/upload-artifact@v3
with:
name: summary-pdf-output
path: /home/runner/mmeds_server_data/test_files/test_study/Qiime2_0/summary/mkstapylton@gmail.com-mattS-qiime2.pdf
- name: Upload Unit coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
run-tests-simple:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install packages
run: pip install -U pip; sudo apt-get install tidy environment-modules -y; pip install cryptography; pip install coverage;
- name: Set PYTHONPATH
run: echo "PYTHONPATH=." >> $GITHUB_ENV
- name: Start Services
run: sudo systemctl start mysql.service; sudo systemctl start mongod.service;
- name: Mysql Setup
run: mysql -u root -proot < setup.sql
- name: Server data setup
run: mkdir /home/runner/mmeds_server_data; mkdir /home/runner/conda_envs; mkdir -p /home/runner/conda_env_files/pheniqs; mkdir -p /home/runner/.modules/modulefiles; cp -r ./test_files /home/runner/mmeds_server_data/.; cp ./mmeds/resources/mmeds_stats.yaml /home/runner/mmeds_server_data/.; cp -r ./modules/* /home/runner/.modules/modulefiles/.; cp -r ./conda_env_files/* /home/runner/conda_env_files/.; mkdir /home/runner/mmeds_server_data/taxonomic_databases; touch /home/runner/mmeds_server_data/taxonomic_databases/dummy_classifier.qza;
- name: Python install
run: sudo python setup.py install --verbose; pip install wheel; pip install git+https://github.com/clemente-lab/mmeds-meta@$GITHUB_REF_NAME;
- name: Install GraphViz
run: sudo apt-get install graphviz
- name: install pheniqs
run: conda env create -f ./conda_env_files/pheniqs_env.yaml -p /home/runner/conda_envs/pheniqs
- name: Unit Tests
run: |
coverage run --parallel-mode --concurrency=multiprocessing ./mmeds/tests/unit/test.py adder authentication database documents error formatter tools uploader util validate spawn snakemake;
- name: Upload Unit coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Server Tests
run: |
pytest --cov=mmeds -W ignore::DeprecationWarning -W ignore::FutureWarning -s --durations=0 ./mmeds/tests/watcher/test_watcher.py&
sleep 1;
pytest --cov=mmeds -W ignore::DeprecationWarning -W ignore::FutureWarning -s ./mmeds/tests/server/test_server.py -x --durations=0;
- name: Upload Server Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Metadata Tests
run: pytest --cov=mmeds -W ignore::DeprecationWarning -W ignore::FutureWarning -s ./mmeds/tests/metadata/test_error_metadata.py;
- name: Load File Action
if: failure()
id: read_file
uses: guibranco/github-file-reader-action-v2@latest
with:
path: "/home/runner/mmeds_server_data/MMEDS_log.txt"
- name: Print MMEDS Logs
if: failure()
run: echo "${{ steps.read_file.outputs.contents }}"