name: typing

on: [push, pull_request]

jobs:
  run-type-checkers:
    name: Run type checkers
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.7", "3.8", "3.9", "3.10"]
    env:
      BACKEND_DIR: "${{ github.workspace }}/.local"
      BACKEND_VERSION: "2.28.0"
    steps:
      - uses: actions/checkout@v3

      - name: Build backend
        run: |
          ./scripts/download-mbedtls.sh $BACKEND_VERSION $BACKEND_DIR/src
          ./scripts/install-mbedtls.sh $BACKEND_DIR/src $BACKEND_DIR

      - uses: actions/setup-python@v3
        with:
          python-version: ${{ matrix.python-version }}
          cache: pip
          cache-dependency-path: |
            requirements.txt
            requirements/typing.txt

      - name: Install deps
        run: >
          python -m pip install
          -r requirements.txt
          -r requirements/typing.txt

      - name: Build and install
        env:
          C_INCLUDE_PATH: "${{ env.BACKEND_DIR }}/include"
          LIBRARY_PATH: "${{ env.BACKEND_DIR }}/lib"
        run: python setup.py --with-coverage build_ext --inplace

      - name: Check typing
        run: mypy .

name: typing

on: [push, pull_request]

jobs:
  run-type-checkers:
    name: Run type checkers
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.7", "3.8", "3.9", "3.10"]
    env:
      BACKEND_DIR: "${{ github.workspace }}/.local"
      BACKEND_VERSION: "2.28.0"
    steps:
      - uses: actions/checkout@v3

      - name: Build backend
        run: |
          ./scripts/download-mbedtls.sh $BACKEND_VERSION $BACKEND_DIR/src
          ./scripts/install-mbedtls.sh $BACKEND_DIR/src $BACKEND_DIR

      - uses: actions/setup-python@v3
        with:
          python-version: ${{ matrix.python-version }}
          cache: pip
          cache-dependency-path: |
            requirements.txt
            requirements/typing.txt

      - name: Install deps
        run: >
          python -m pip install
          -r requirements.txt
          -r requirements/typing.txt

      - name: Build and install
        env:
          C_INCLUDE_PATH: "${{ env.BACKEND_DIR }}/include"
          LIBRARY_PATH: "${{ env.BACKEND_DIR }}/lib"
        run: python setup.py --with-coverage build_ext --inplace

      - name: Check typing
        run: |
          mypy .
          mypy --strict programs src

Check src and programs with mypy --strict
ci: Check src and programs with mypy --strict
