-
Notifications
You must be signed in to change notification settings - Fork 20
74 lines (71 loc) · 2.21 KB
/
run_pytests.yaml
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
name: scikit_mol ci
on: [push, pull_request]
jobs:
# run pytests for scikit_mol
tests:
name: pytest ${{ matrix.os }}::py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 6
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10"]
include:
# test python version compatibility on linux only
- os: ubuntu-latest
python-version: 3.12
- os: ubuntu-latest
python-version: 3.11
- os: ubuntu-latest
python-version: 3.10
- os: ubuntu-latest
python-version: 3.9
- os: ubuntu-latest
python-version: 3.8
- os: ubuntu-latest
python-version: 3.7
steps:
- name: Checkout scikit_mol
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install scikit_mol
run: python -m pip install -e .[dev]
- name: Cache tests/data
uses: actions/cache@v3
with:
path: tests/data
key: ${{ runner.os }}-${{ hashFiles('tests/conftest.py') }}
- name: Run Tests
run: pytest --cov=./scikit_mol .
# deploy scikit_mol to pypi for tagged commits if tests pass
deploy:
needs: [ tests ]
name: deploy to pypi
runs-on: ubuntu-latest
# this checks that the commit is a tagged commit
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build a binary wheel and a source tarball
run: |
python -m build .
# push all tagged versions to pypi.org
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}