-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (79 loc) · 2.51 KB
/
tests.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Tests
on:
push:
workflow_dispatch:
inputs:
python_v:
description: "python version"
required: true
default: "3.9"
type: choice
options:
- "3.9"
- "3.10"
- "3.11"
commit_ref:
description: Specific ref (branch, tag or SHA)
default: ""
type: string
required: false
long:
description: "Run long tests"
required: false
default: false
type: boolean
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJSON(github.event_name == 'workflow_dispatch' && format('["{0}"]', github.event.inputs.python_v) || '["3.9", "3.10", "3.11"]') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_ref || github.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Install os specific dependencies
if: ${{ github.event.inputs.long == 'true' || github.ref_name == 'main' }}
run: |
pip install .
sudo apt-get update
sudo apt install -y poppler-utils
sudo apt-get install -y texlive-latex-base texlive-pictures texlive-latex-extra
- name: Run tests
run: |
if [ "${{ github.event.inputs.long }}" == "true" ] || [ "${{ github.ref_name }}" == "main" ]; then
python -m pytest --long-local
else
python -m pytest
fi
typechecks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJSON(github.event_name == 'workflow_dispatch' && format('["{0}"]', github.event.inputs.python_v) || '["3.9", "3.10", "3.11"]') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_ref || github.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run type checker
run: pyright