-
Notifications
You must be signed in to change notification settings - Fork 15
98 lines (96 loc) · 2.7 KB
/
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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test-core:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.9"]
defaults:
run:
shell: bash -l {0}
name: test-core (Python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
- name: Install syntheseus
run: |
pip install .[dev]
- name: Run pre-commit
run: |
pre-commit run --verbose --all-files
- name: Run unit tests
run: |
coverage run -p -m pytest ./syntheseus/tests/
coverage report --data-file .coverage.*
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: .coverage.core-${{ matrix.python-version }}
path: .coverage.*
include-hidden-files: true
test-models:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
name: test-models
steps:
- name: Free extra disk space
uses: jlumbroso/free-disk-space@main
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
environment-file: environment_full.yml
- name: Install syntheseus with all single-step models
run: |
sudo apt install graphviz
pip install .[all]
- name: Run single-step model tests
run: |
coverage run -p -m pytest \
./syntheseus/tests/cli/test_cli.py \
./syntheseus/tests/reaction_prediction/inference/test_models.py \
./syntheseus/tests/reaction_prediction/utils/test_parallel.py
coverage report --data-file .coverage.*
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: .coverage.models
path: .coverage.*
include-hidden-files: true
coverage:
needs: [test-core, test-models]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Generate a combined coverage report
run: |
coverage combine
coverage report