-
Notifications
You must be signed in to change notification settings - Fork 9
92 lines (75 loc) · 2.1 KB
/
ci.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
name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request: {}
workflow_dispatch:
jobs:
test:
name: ${{ matrix.platform }} (${{ matrix.python-version }})
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.10", "3.11"]
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[testing]
- name: Test with
run: pytest -v --color=yes --cov=psfmodels --cov-report=xml
- name: Coverage
uses: codecov/codecov-action@v3
build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.10"
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Build sdist
if: matrix.os == 'ubuntu-20.04'
run: |
python -m pip install build
python -m build --sdist
- uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-20.04'
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build]
runs-on: ubuntu-latest
if: "success() && startsWith(github.ref, 'refs/tags/')"
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_token }}
- uses: softprops/action-gh-release@v1
with:
generate_release_notes: true