Repository navigation
96 lines (91 loc) · 2.62 KB
/
Copy pathci.yml
File metadata and controls
96 lines (91 loc) · 2.62 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
name: ci
on:
push:
branches: [main, master]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.13"]
include:
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
- os: ubuntu-latest
python-version: "3.14"
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Lint
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
run: ruff check src tests tools
- name: Type check
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
run: mypy src/zipcheck
- name: Test
run: python -m pytest
coverage:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Coverage
run: |
python -m pytest \
--cov=zipcheck \
--cov-report=term-missing \
--cov-fail-under=70
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Build distributions
run: |
python -m pip install --upgrade pip build twine
python -m build
twine check dist/*
- name: Smoke-test the wheel
run: |
python -m venv .venv-wheel
.venv-wheel/bin/pip install dist/*.whl
.venv-wheel/bin/zipcheck --version
python - <<'PY'
import zipfile
with zipfile.ZipFile("sample.zip", "w", zipfile.ZIP_DEFLATED) as zf:
zf.writestr("hello.txt", b"hello" * 100)
PY
.venv-wheel/bin/zipcheck sample.zip
- name: Smoke-test the sdist
run: |
python -m venv .venv-sdist
.venv-sdist/bin/pip install dist/*.tar.gz
.venv-sdist/bin/zipcheck --version
.venv-sdist/bin/zipcheck sample.zip