-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (64 loc) · 2 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.12"] # tokenizers not supporting 3.13 yet
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install uv
uses: yezz123/setup-uv@v4
- name: Install dependencies (uv sync)
run: uv sync --all-extras
- name: Check for code issues (ruff check)
uses: astral-sh/ruff-action@v1
- name: Check code format (ruff format)
uses: astral-sh/ruff-action@v1
with:
args: "format --check"
- name: Static type checking (MyPy)
run: uv run mypy src/jinjarope/
- name: Run tests
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: uv run pytest --cov-report=xml
- name: Upload test results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
verbose: true
release:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/')
permissions:
# this permission is mandatory for trusted publishing
id-token: write
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: yezz123/setup-uv@v4
- name: Build package
run: uv build
- name: Release package on PyPI
run: uv publish
- name: Release package on GitHub
uses: ncipollo/release-action@v1
with:
body: ${{ github.event.head_commit.message }}
artifacts: dist/*.whl,dist/*.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}