-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (68 loc) · 2.92 KB
/
Copy pathpython-package.yml
File metadata and controls
82 lines (68 loc) · 2.92 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
name: Python Package
on:
push:
branches: [main, 'release/**', 'fix/**', 'feat/**']
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install --upgrade pip
# Editable install, so `import applyr` in tests resolves to this
# checkout rather than a separate installed copy — cheap insurance
# for coverage measurement matching the tracked source tree.
pip install -e ".[dev]"
# The v0.8.0 audit found 7 of 8 bugs in modules with no tests, because the
# suite was never executed here — this job only smoke-tested the CLI.
- name: Run unit tests with coverage
run: pytest --cov=applyr --cov-report=term
- name: Verify import
run: python -c "from applyr.cli import main; print('Import OK')"
- name: Verify version
run: applyr version
- name: Verify init
run: applyr init
# The database-recreation defect lived in cli.py routing and was invisible
# to unit tests calling cmd_doctor() directly — only the real binary shows
# it. Chrome is absent on the runner, which also proves it does not block.
- name: Verify doctor gates on health
run: |
if applyr doctor; then echo "doctor must exit 1 on an unfilled cv-master"; exit 1; fi
python -c "import pathlib,os; p=pathlib.Path(os.path.expanduser('~/.applyr/cv-master.md')); p.write_text('# CV Master\n\n' + 'Real experience. ' * 200)"
applyr doctor
applyr doctor --json | python -c "import sys,json; d=json.load(sys.stdin); assert d['healthy'] is True, d"
rm ~/.applyr/jobs.db
if applyr doctor; then echo "doctor must exit 1 when the database is gone"; exit 1; fi
test ! -f ~/.applyr/jobs.db || { echo "doctor must not recreate the database"; exit 1; }
applyr init
- name: Verify add + show
run: |
applyr add '{"title": "Test Job", "company": "TestCorp", "work_mode": "remote", "status": "applied", "tech_stack": "Python", "topics": {"tech_stack": {"score": 80, "detail": "OK"}}}'
applyr show 1
applyr list
applyr pipeline
applyr stats
applyr gaps
applyr trends
applyr summary --json
- name: Verify export
run: applyr export --format json --file /tmp/test-export.json
- name: Verify error handling
run: |
applyr add '{}' 2>&1 | grep -q "title"
applyr show 999 2>&1 | grep -q "not found"
- name: Build package
run: |
pip install build
python -m build