-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (108 loc) · 2.99 KB
/
pytest.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
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: Python package
on:
workflow_dispatch:
push:
branches: ["main", "quarto**"]
pull_request:
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install dependencies
run: |
pip install -e ".[dev,test]"
- name: Install
run: |
make install
- name: Run unit tests
run: |
make test
- name: pyright, flake8, black and isort
run: |
make check
docs:
permissions:
contents: write
name: "Build Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install dependencies
run: |
# Install latest quartodoc from GitHub
pip install -e ".[dev,test,docs]"
- name: Install
run: |
make install
- name: Render quarto site
run: |
make docs-ci
- name: Publish to GitHub Pages (on push)
if: github.event_name == 'push'
uses: quarto-dev/quarto-actions/publish@v2
with:
path: docs
render: false
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: "Deploy to PyPI"
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: [build]
steps:
- uses: actions/checkout@v3
- name: "Set up Python 3.11"
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,test,docs]"
- name: "Build Package"
run: |
make dist
# test deploy ----
- name: "Test Deploy to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.event.release.name, 'TEST')
with:
user: __token__
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
## prod deploy ----
- name: "Deploy to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ !startsWith(github.event.release.name, 'TEST') }}
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}