-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (53 loc) · 1.52 KB
/
Copy pathpython.yml
File metadata and controls
62 lines (53 loc) · 1.52 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
name: Python
on:
push:
branches: [main]
paths: [src/swift_book_pdf/**, tests/**, uv.lock, pyproject.toml, .github/workflows/**]
pull_request:
branches: [main]
paths: [src/swift_book_pdf/**, tests/**, uv.lock, pyproject.toml, .github/workflows/**]
jobs:
build:
name: Test Python
permissions:
contents: read
timeout-minutes: 10
runs-on: ubuntu-latest
env:
wd: ./
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Setup uv
id: setup-uv
uses: astral-sh/setup-uv@e06108dd0aef18192324c70427afc47652e63a82
with:
enable-cache: true
- name: Set up Python3.x
uses: actions/setup-python@v6
with:
python-version: 3.11.6
id: py
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Cache npm downloads
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-24-npm-highlightjs-latest
restore-keys: |
${{ runner.os }}-node-24-npm-
- name: Get requirements
working-directory: ${{env.wd}}
run: |
uv sync --locked --color never
- name: Linting, formatting, and type checking
working-directory: ${{env.wd}}
run: uv run pre-commit run --show-diff-on-failure --all-files
- name: Run tests
working-directory: ${{env.wd}}
env:
SWIFT_BOOK_CORPUS_TEST: "1"
run: uv run pytest