-
Notifications
You must be signed in to change notification settings - Fork 8
67 lines (63 loc) · 1.86 KB
/
test.yml
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
name: Unit tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
linter:
name: Linters
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Cache python packages
uses: actions/cache@v3
with:
path: ${{ env.Python3_ROOT_DIR }}/lib/python3.11/site-packages
key: linting-packages-${{ hashFiles('**/pyproject.toml') }}-3.11
- name: Install dependencies
run: pip install -e '.[linting,testing]'
- name: Lint with ruff
run: |
pip3 install --upgrade --force-reinstall ruff
python3 -m ruff .
- name: Run mypy
run: python -m mypy
# - name: Use as an external package
# run: |
# mkdir $HOME/test_external_dir
# cd $HOME/test_external_dir
# python -m venv venv
# source venv/bin/activate
# pip install $GITHUB_WORKSPACE
# python -c "from hotpdf import Hotpdf; print(Hotpdf())"
tests:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install ghostscript
run: sudo apt-get install ghostscript
- name: Cache python packages
uses: actions/cache@v3
with:
path: ${{ env.Python3_ROOT_DIR }}/lib/python3.11/site-packages
key: testing-packages-${{ hashFiles('**/pyproject.toml') }}-3.11
- name: Install dependencies
run: pip install -e '.[testing]'
- name: Run tests with coverage
run:
python -m pytest --cov=hotpdf -n=auto tests/ --cov-fail-under=100