-
Notifications
You must be signed in to change notification settings - Fork 28
131 lines (124 loc) · 4.2 KB
/
run_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
# Copyright 2020 Open Reaction Database Project Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Tests
on: [ pull_request, push ]
jobs:
test_ord_schema:
runs-on: ubuntu-latest
env:
PGDATA: $GITHUB_WORKSPACE/rdkit-postgres
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
- name: Setup PostgreSQL
shell: bash -l {0}
run: |
# NOTE(skearnes): conda is only used for postgres (not python).
conda install -c rdkit rdkit-postgresql==2020.03.3.0
initdb
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install ord_schema
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install .[tests]
- name: Run tests
shell: bash -l {0}
run: |
coverage erase
pytest -n auto -vv --cov=ord_schema --durations=0 --durations-min=1
coverage xml
- uses: codecov/codecov-action@v1
test_notebooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install ord_schema
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install .[examples,tests]
- name: Test notebooks
run: |
treon
test_proto_wrappers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install protoc
run: |
python -m pip install --upgrade pip
python -m pip install wheel
mkdir protoc
cd protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip
unzip protoc-22.3-linux-x86_64.zip
wget https://github.com/protocolbuffers/protobuf-javascript/releases/download/v3.21.2/protobuf-javascript-3.21.2-linux-x86_64.zip
unzip protobuf-javascript-3.21.2-linux-x86_64.zip
PATH=$GITHUB_WORKSPACE/protoc/bin:$PATH protoc --version
- name: Run protoc
run: |
PATH=$GITHUB_WORKSPACE/protoc/bin:$PATH ./compile_proto_wrappers.sh
./format.sh # Add license headers.
- name: Check for drift
run: |
# Ignore the copyright line in the diff so the year can change.
[[ -z $(git diff -I "^(#| \*) Copyright") ]] || { echo "proto wrappers do not match:\n$(git diff)"; exit 1; }
test_js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Test NPM package
run: |
cd js/ord-schema
npm install-test
test_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Test bump patch version
run: |
git config user.name github-actions
git config user.email github-actions@github.com
python -m pip install bump2version
bump2version patch --verbose
- name: Test python
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build twine wheel
python -m build
- name: Test javascript
run: |
cd js/ord-schema
npm install
npm run build
npm publish --dry-run