Add Mid-Level API #14
Workflow file for this run
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: mypy | |
on: | |
- pull_request | |
jobs: | |
mypy: | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: true | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.9", "3.10", "3.11"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
#---------------------------------------------- | |
# ----- install poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# install or use cached dependencies | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
# always install current root package | |
- name: Install library | |
run: poetry install --no-interaction | |
#---------------------------------------------- | |
# ----- setup matchers & run mypy ----- | |
#---------------------------------------------- | |
- name: Setup matchers | |
run: | | |
echo "::add-matcher::.github/workflows/matchers/mypy.json" | |
echo "TERM: changing from $TERM -> xterm" | |
export TERM=xterm | |
- name: Run mypy | |
# NOTE: tomli is sometimes missing, install it explicitly | |
run: | | |
source $VENV | |
pip install tomli | |
mypy --show-column-numbers . |