Skip to content

Commit

Permalink
Add type checks to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorjerse committed May 7, 2024
1 parent 14cc33f commit c002030
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Type checking

on:
push:
branches:
- master
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
pull_request:
branches:
- master
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
test:
runs-on: arc-runner

env:
TOX_COMMAND: "tox --skip-missing-interpreters false"

strategy:
matrix:
toxenv: ["py310", "py311", "py312"]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Mypy
run: |
${{ env.TOX_COMMAND }} -e mypy
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"package": ["twine", "wheel"],
"test": [
"black==24.1.0",
"mypy>=1.10.0",
"django-stubs>=4.2.4",
"django-filter-stubs>=0.1.3",
"djangorestframework-stubs[compatible-mypy]>=3.14.0",
Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ envlist =
linters,
packaging,
extra,
migrations
migrations,
mypy
skip_missing_interpreters = True
# This is the highest version of tox available on our test server.
minversion = 3.5.0
Expand Down Expand Up @@ -72,6 +73,9 @@ commands =
py3{10,11,12}-partial: --changes-file-types .resolwebio-filetypes.yml \
py3{10,11,12}: --verbosity 2 --parallel

# Check types.
mypy: python -m mypy resolwe_bio

# Docs commands:
# Build documentation.
docs: python setup.py build_sphinx --fresh-env --warning-is-error
Expand Down

0 comments on commit c002030

Please sign in to comment.