-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (69 loc) · 2.6 KB
/
Copy pathci.yml
File metadata and controls
85 lines (69 loc) · 2.6 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
name: Workspace CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
concurrency:
group: workspace-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.14"
- name: Set up Rust
uses: dtolnay/rust-toolchain@1.100.0
- name: Sync development dependencies
run: uv sync --group dev
- name: Configure PyO3 test environment
shell: bash
run: |
PYTHON_BIN="$(uv run --group dev python - <<'PY'
import sys
print(sys.executable)
PY
)"
PYTHON_LIBDIR="$(uv run --group dev python - <<'PY'
import sysconfig
print(sysconfig.get_config_var("LIBDIR") or "")
PY
)"
echo "PYO3_PYTHON=$PYTHON_BIN" >> "$GITHUB_ENV"
if [ -n "$PYTHON_LIBDIR" ]; then
echo "LD_LIBRARY_PATH=$PYTHON_LIBDIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
echo "LIBRARY_PATH=$PYTHON_LIBDIR${LIBRARY_PATH:+:$LIBRARY_PATH}" >> "$GITHUB_ENV"
fi
- name: Run Rust tests
run: cargo test --manifest-path rust/Cargo.toml --workspace --tests
- name: Run Python tests
run: uv run --group dev pytest json-tstring/tests toml-tstring/tests yaml-tstring/tests -q
- name: Check formatting
run: uv run --group dev ruff format --check json-tstring toml-tstring yaml-tstring tstring-core rust/python-bindings/python
- name: Run Ruff
run: uv run --group dev ruff check json-tstring/src toml-tstring/src yaml-tstring/src tstring-core/src rust/python-bindings/python/tstring_bindings
- name: Run type checks
run: uv run --group dev ty check json-tstring/src json-tstring/tests toml-tstring/src toml-tstring/tests yaml-tstring/src yaml-tstring/tests tstring-core/src rust/python-bindings/python
- name: Build distributions
run: |
uv build tstring-core --out-dir dist
uv build json-tstring --out-dir dist
uv build toml-tstring --out-dir dist
uv build yaml-tstring --out-dir dist
uv build rust/python-bindings --out-dir dist
- name: Check distribution metadata
run: uvx twine check dist/*
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: python-distributions
path: dist/*