-
Notifications
You must be signed in to change notification settings - Fork 18
78 lines (69 loc) · 2.25 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
name: CI
on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]
permissions:
actions: read
contents: write
env:
POETRY_VERSION: "1.6.1"
PYTHON_VERSION: "3.11"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Needed for docs to discover gh-pages branch
fetch-depth: 0
- uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ env.POETRY_VERSION }}-${{ steps.setup-python.outputs.python-version }}
- name: Install Poetry
id: install-poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
# If changing any of these, you must comment out the if statement above.
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Poetry git plugin
run: poetry self add poetry-git-version-plugin
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Poetry Install
run: poetry install -n -v
- name: Poetry Build
run: poetry build -v
- name: Ruff
run: poetry run ruff .
- name: Black
run: poetry run black .
- name: Pytest
run: poetry run pytest
- name: Check generated stubs
run: poetry run python -m ziglang build --build-file pytest.build.zig generate-stubs -Dcheck-stubs=true
- name: Zig Docs Build
run: poetry run python -m ziglang build docs
- name: Setup doc deploy
run: |
git config --global user.name Docs Deploy
git config --global user.email [email protected]
- name: MKDocs Build
run: poetry run mike deploy develop --push
if: ${{ github.ref == 'refs/heads/develop' }}