Fix: review comment #833
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |