forked from alchemistry/alchemtest
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (90 loc) · 2.91 KB
/
Copy pathCI.yaml
File metadata and controls
110 lines (90 loc) · 2.91 KB
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
name: CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
schedule:
# Weekly tests run every Saturday on master by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "34 2 * * 6"
concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}"
cancel-in-progress: true
jobs:
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
# Only test lowest and highest version on the expensive/slow
# macOS and windows runners (UPDATE when supported versions change):
exclude:
- os: macOS-latest
python-version: 3.8
- os: macOS-latest
python-version: 3.9
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: Install pytest, pytest plugins
run: |
python -m pip install wheel
python -m pip install pytest pytest-cov pytest-pep8
- name: Install package
run: |
python -m pip install .
- name: Run tests
# conda setup requires this special shell
shell: bash -l {0}
run: |
pytest -v --cov=alchemtest --cov-report=xml --color=yes src/alchemtest/tests
- name: CodeCov
uses: codecov/codecov-action@v1
with:
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
file: ./coverage.xml
flags: unittests
fail_ci_if_error: true
pypi_check:
name: Check source package integrity (for PyPi deployment)
if: "github.repository == 'alchemistry/alchemtest'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install tools
run: |
python -m pip install setuptools twine
- name: Build alchemtest source dist
run: |
python setup.py sdist
- name: Check package build sdist
run: |
DISTRIBUTION=$(ls -t1 dist/alchemtest-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no distribution dist/alchemtest-*.tar.gz found"; exit 1; }
echo "twine check $DISTRIBUTION"
twine check $DISTRIBUTION