Add MyPy to CI

This commit is contained in:
Marks Polakovs 2023-03-11 12:40:24 +00:00
parent 0d953961ef
commit ada88ba73e

View file

@ -6,9 +6,9 @@ name: Checks
# events but only for the master branch # events but only for the master branch
on: on:
push: push:
branches: [ master ] branches: [master]
pull_request: pull_request:
branches: [ master ] branches: [master]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs: jobs:
@ -18,32 +18,45 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job # Steps represent a sequence of tasks that will be executed as part of the job
steps: steps:
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1 - uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install dependencies - name: Install dependencies
run: yarn install --frozen-lockfile run: yarn install --frozen-lockfile
# Type checks # Type checks
- name: TypeScript Error Reporter - name: TypeScript Error Reporter
uses: icrawl/action-tsc@v1 uses: icrawl/action-tsc@v1
# ESLint # ESLint
- name: ESLint Action - name: ESLint Action
run: node_modules/.bin/eslint src/ --ext .ts,.tsx run: node_modules/.bin/eslint src/ --ext .ts,.tsx
# Prettier # Prettier
- name: Prettier - name: Prettier
run: node_modules/.bin/prettier -c 'src/**/*.{js,ts,tsx,css,scss}' run: node_modules/.bin/prettier -c 'src/**/*.{js,ts,tsx,css,scss}'
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: poetry
- run: poetry install --with=dev
- name: MyPy checks
run: poetry run mypy *.py