-
Notifications
You must be signed in to change notification settings - Fork 9
53 lines (53 loc) · 1.5 KB
/
workflow.yml
File metadata and controls
53 lines (53 loc) · 1.5 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
on:
# Run on any push to master.
push:
branches:
- master
# Run on published releases.
release:
types:
- published
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: cache
uses: actions/cache@v4
# Keep uv cache and Python virtual environment.
with:
key: ${{ hashFiles('pyproject.toml', 'uv.lock') }}
path: |
~/.local/share/uv
.venv
- run: |
# Test
curl -LsSf https://astral.sh/uv/install.sh | sh
uvx ruff format --check --exclude notebook.py # marimo manages notebook formatting
uv run --python 3.11 -m pytest -v
uv run --python 3.12 -m pytest -v
uv run --python 3.13 -m pytest -v
uv run --python 3.14 -m pytest -v
publish:
needs: test
# Only publish if releasing.
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
# Allows JWT to be requested from GitHub's OIDC provider for publishing to PyPI.
id-token: write
steps:
- uses: actions/checkout@v4
- id: cache
uses: actions/cache@v4
# Keep uv cache and Python virtual environment.
with:
key: ${{ hashFiles('pyproject.toml', 'uv.lock') }}
path: |
~/.local/share/uv
.venv
- run: |
# Build and publish to PyPI.
curl -LsSf https://astral.sh/uv/install.sh | sh
uv build
uv publish