-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (98 loc) · 2.49 KB
/
build.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
name: Build and test
on:
push:
branches:
- main
- master
- release/**
pull_request:
branches:
- main
- master
- release/**
jobs:
tarball:
name: Build
runs-on: ubuntu-latest
steps:
- name: Get source code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install build requirements
run: python -m pip install build wheel
- name: Create distributions
run: python -m build . --sdist --wheel --outdir .
- uses: actions/upload-artifact@v2
with:
name: tarball
path: ligotimegps-*.tar.*
- uses: actions/upload-artifact@v2
with:
name: wheel
path: ligotimegps*.whl
build-and-test:
name: Test ${{ matrix.python-version }} (${{ matrix.os }})
needs:
- tarball
# using bash makes things easier
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os:
- macOS
- Ubuntu
- Windows
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
runs-on: ${{ matrix.os }}-latest
steps:
- name: Get source code
uses: actions/checkout@v2
- name: Download tarball
uses: actions/download-artifact@v2
with:
name: tarball
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install LIGOTimeGPS with test extras
run: |
TARBALL=$(ls ligotimegps-*.tar.*)
python -m pip install ${TARBALL}[test]
- name: Package list
run: python -m pip list installed
- name: Run test suite
run: |
python -m pytest \
-ra \
--color yes \
--cov ligotimegps \
--cov-report=xml \
--junitxml=pytest.xml \
--pyargs ligotimegps \
;
- name: Coverage report
run: python -m coverage report --show-missing
- name: Publish coverage to Codecov
uses: codecov/codecov-action@v1.2.1
with:
files: coverage.xml
flags: ${{ runner.os }},python${{ matrix.python-version }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
with:
name: pytest-conda-${{ matrix.os }}-${{ matrix.python-version }}
path: pytest.xml