-
Notifications
You must be signed in to change notification settings - Fork 115
141 lines (118 loc) · 3.1 KB
/
dist.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
132
133
134
135
136
137
138
139
140
141
# ---------------------------
#
# Prepare distributions of this project
# and run a basic build-and-test from the
# tarball to make sure that actually works.
#
# Note: we don't test this on Windows because
# ligo-segments doesn't install cleanly
# from the PyPI tarball, we would need
# to use conda.
#
# ---------------------------
name: Distribution
on:
push:
branches:
- main
- master
- release/**
pull_request:
branches:
- main
- master
- release/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tarball:
name: Build
runs-on: ubuntu-latest
steps:
- name: Get source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install build requirements
run: python -m pip install build
- name: Create distributions
run: python -m build . --sdist --wheel --outdir .
- uses: actions/upload-artifact@v3
with:
name: tarball
path: gwpy-*.tar.*
- uses: actions/upload-artifact@v3
with:
name: wheel
path: gwpy*.whl
# -- pip install test -----
pip-install:
name: Python ${{ matrix.python-version }} install from ${{ matrix.artifact }} (${{ matrix.os }})
needs:
- tarball
strategy:
fail-fast: false
matrix:
artifact:
- tarball
- wheel
os:
- macOS
- Ubuntu
- Windows
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash -e {0}
steps:
- name: Download ${{ matrix.artifact }}
uses: actions/download-artifact@v3
with:
name: ${{ matrix.artifact }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install GWpy with test extras
run: |
# extras don't work with wildcards
DIST=$(ls gwpy-*.*)
python -m pip install ${DIST}[test]
- name: Package list
run: python -m pip list installed
- name: Run test suite
run: |
python -m pytest \
-ra \
--color yes \
--cov gwpy \
--cov-report=xml \
--disable-socket \
--allow-hosts=127.0.0.1 \
--junitxml=pytest.xml \
--pyargs gwpy \
;
- name: Coverage report
run: python -m coverage report --show-missing
- name: Publish coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
flags: ${{ runner.os }},python${{ matrix.python-version }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: pytest-${{ matrix.artifact }}-${{ matrix.os }}-${{ matrix.python-version }}
path: pytest.xml