-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.57 KB
/
Copy pathci.yml
File metadata and controls
60 lines (49 loc) · 1.57 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
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: ["3.14", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.12.7"
- name: Install fd and ripgrep (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y fd-find ripgrep
sudo ln -sf "$(command -v fdfind)" /usr/local/bin/fd
- name: Install fd and ripgrep (macOS)
if: runner.os == 'macOS'
run: brew install fd ripgrep
- name: Install rtk shim
# rtk has no apt/brew package; CI uses a pass-through shim.
run: |
cat > /tmp/rtk <<'EOF'
#!/bin/sh
# Minimal rtk shim: `rtk rewrite` passes stdin through unchanged.
if [ "$1" = "rewrite" ]; then cat; else exit 0; fi
EOF
chmod +x /tmp/rtk
if [ "$RUNNER_OS" = "Windows" ]; then exit 1; fi
sudo cp /tmp/rtk /usr/local/bin/rtk 2>/dev/null || cp /tmp/rtk "$HOME/.local/bin/rtk"
- name: Set up Python
run: uv python install ${{ matrix.python }}
- name: Install dependencies
run: uv sync --python ${{ matrix.python }} --extra telemetry
- name: ruff check
run: uv run ruff check
- name: ruff format check
run: uv run ruff format --check
- name: pytest
run: uv run python -m pytest