-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (101 loc) · 3.15 KB
/
ci.yml
File metadata and controls
131 lines (101 loc) · 3.15 KB
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
name: CI/CD
on:
push:
branches: [main]
pull_request:
env:
UV_LINK_MODE: "copy"
UV_FROZEN: "1"
permissions:
contents: write
jobs:
linting:
name: "Code Linting"
runs-on: ubuntu-latest
container:
image: ghcr.io/astral-sh/uv:0.6-python3.11-bookworm-slim
steps:
- uses: actions/checkout@v4
- name: Install lint dependencies
run: uv sync --group linting
- name: Check code style with Ruff
run: uv run ruff check .
- name: Check code formatting with Ruff
run: uv run ruff format --check .
- name: Check type hints with mypy
run: uv run mypy .
tests:
name: "Run Tests"
needs: linting
runs-on: ubuntu-latest
container:
image: jupyter/pyspark-notebook
options: --user root
steps:
- name: Install git (needed for checkout)
run: |
apt-get update && apt-get install -y git
- uses: actions/checkout@v4
- name: Install uv
run: pip install uv
- name: Install test dependencies
run: uv sync --group test
- name: Run unit tests
run: uv run pytest --cov -v --cov-report=term --cov-report=xml
- name: Upload test results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
release:
name: "Publish Package"
if: github.ref == 'refs/heads/main'
needs: tests
runs-on: ubuntu-latest
container:
image: ghcr.io/astral-sh/uv:0.6-python3.11-bookworm
permissions:
id-token: write
contents: write
steps:
- name: Setup | Checkout Repository on Release Branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
- name: Action | Semantic Version Release
id: release
uses: python-semantic-release/python-semantic-release@v10.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: "github-actions"
git_committer_email: "actions@users.noreply.github.com"
- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/publish-action@v10.3.0
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
- name: Publish | Upload package to PyPI
if: steps.release.outputs.released == 'true'
run: |
export UV_PUBLISH_TOKEN=${{ secrets.UV_PUBLISH_TOKEN }}
uv build
uv publish
pages:
name: "Publish Documentation to GitHub Pages"
if: github.ref == 'refs/heads/main'
needs: release
runs-on: ubuntu-latest
container:
image: ghcr.io/astral-sh/uv:0.6-python3.11-bookworm
steps:
- uses: actions/checkout@v4
- name: Install docs dependencies
run: uv sync --group docs
- name: Build documentation
run: uv run sphinx-build -b html docs/source public
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public