-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (82 loc) · 2.68 KB
/
ci.yml
File metadata and controls
103 lines (82 loc) · 2.68 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
branches: ["**"] # All branches
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync --dev
uv pip install -e .
- name: Run ruff check
run: uv run ruff check . --output-format=github
- name: Run ruff format check
run: uv run ruff format --check --diff .
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync --dev
uv pip install -e .
- name: Download 7zz binary for testing
run: |
# Download official 7zz binary (same as build workflow)
VERSION="25.00"
VERSION_FOR_ASSET=$(echo "$VERSION" | sed 's/\.//g') # 25.00 -> 2500
ASSET_NAME="7z${VERSION_FOR_ASSET}-linux-x64.tar.xz"
DOWNLOAD_URL="https://github.com/ip7z/7zip/releases/download/${VERSION}/${ASSET_NAME}"
echo "Downloading 7zz from: $DOWNLOAD_URL"
TEMP_DIR=$(mktemp -d)
curl -L -o "${TEMP_DIR}/${ASSET_NAME}" "$DOWNLOAD_URL"
cd "${TEMP_DIR}"
tar -xf "${ASSET_NAME}"
# Find and install the 7zz binary
BINARY_PATH=$(find . -name "7zz" -type f | head -1)
if [ -n "$BINARY_PATH" ]; then
sudo cp "$BINARY_PATH" /usr/local/bin/7zz
sudo chmod +x /usr/local/bin/7zz
echo "7zz binary installed successfully"
# Set environment variable for tests
echo "PY7ZZ_BINARY=/usr/local/bin/7zz" >> $GITHUB_ENV
# Verify installation
/usr/local/bin/7zz --help > /dev/null && echo "7zz verification passed" || exit 1
else
echo "Error: 7zz binary not found in downloaded package"
exit 1
fi
# Clean up
cd "$GITHUB_WORKSPACE"
rm -rf "${TEMP_DIR}"
- name: Run pytest
run: uv run pytest -v --tb=short
- name: Run mypy
run: uv run mypy .