-
Notifications
You must be signed in to change notification settings - Fork 2
208 lines (184 loc) · 5.08 KB
/
dgpy-libs-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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: dgpy-libs-ci
on: [push, pull_request]
jobs:
fmtc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: ruff-check
run: |
python -m pip install --upgrade pip
pip install -U ruff
ruff format --check .
ruff check --select "I" .
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup-python-3
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: install-upgrade-pip
run: |
python -m pip install --upgrade pip
- name: install-ruff
run: |
pip install ruff
- name: ruff-version
run: |
ruff --version
- name: ruff-check
run: |
ruff check .
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: mypy
run: |
pip install nox
nox -s lint
test:
runs-on: ubuntu-latest
# matrix of python versions to test against
strategy:
matrix:
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
# set uv environment variables
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
# - name: install-uv
# run: curl -LsSf https://astral.sh/uv/install.sh | sh
# - name: python-sane-setup
# run: |
# python -m pip install --upgrade pip
# - name: setup-poetry
# id: setup-poetry
# uses: ./.github/actions/setup-poetry
- name: uv-sync
run: uv sync --all-extras --dev
# - name: Install dependencies
# run: |
# poetry install
- name: test-dgpydev
run: |
uv run pytest --doctest-modules tests
- name: test listless
run: |
cd libs/listless
uv run pytest --doctest-modules
- name: test fmts
run: |
cd libs/fmts
uv run pytest --doctest-modules
- name: test xtyping
run: |
cd libs/xtyping
uv run pytest
- name: test funkify
run: |
cd libs/funkify
uv run pytest --cov=funkify
- name: test asyncify
run: |
cd libs/asyncify
uv run pytest --cov=asyncify --doctest-modules
- name: test requires
run: |
cd libs/requires
uv run pytest tests
- name: test aiopen
run: |
cd libs/aiopen
uv run pytest --doctest-modules
- name: test lager
run: |
cd libs/lager
uv run pytest tests
- name: test jsonbourne
run: |
cd libs/jsonbourne
uv run pytest --doctest-modules
- name: test shellfish
run: |
cd libs/shellfish
uv run pytest --doctest-modules
- name: test dgpylibs
run: |
cd libs/dgpylibs
uv run pytest --doctest-modules
# -----
# NOT SURE IF THESE WERE ACTUALLY DOING ANYTHING USEFUL ANYMORE
# -----
# test-jsonbourne:
# needs: [lint]
# runs-on: ubuntu-latest
# strategy:
# matrix:
# os:
# - ubuntu
# python-version: ["3.8", "3.9", "3.10", "3.11"]
# 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
# pip install flake8 pytest nox
# - name: Test with pytest
# run: |
# cd libs/jsonbourne
# nox -k test
mkdocs:
permissions:
contents: write
deployments: write
needs: [lint, test]
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: install-uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: uv-sync
run: uv sync --all-extras --dev
# - name: setup-poetry
# id: setup-poetry
# uses: ./.github/actions/setup-poetry
# - name: poetry install
# run: |
# poetry install
- name: install docs deps
run: uv pip install '.[docs]'
- name: mkdocs build
if: github.ref != 'refs/heads/main'
run: uv run mkdocs build
- name: mkdocs build
if: github.ref == 'refs/heads/main'
run: uv run mkdocs gh-deploy --force