name: TechDocs

on:
  pull_request:
    paths:
      - '.github/workflows/techdocs.yml'
      - 'packages/techdocs-cli/**'
      - 'plugins/techdocs/**'

jobs:
  build:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest]
        python-version: [3.7]

    env:
      TECHDOCS_CORE_PATH: ./plugins/techdocs/mkdocs/container/techdocs-core

    name: Python ${{ matrix.node-version }} on ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2

      # Lint Python code for techdocs-core package
      - name: prepare python environment
        run: |
          python3 -m pip install --index-url https://pypi.org/simple/ setuptools
          python3 -m pip install --upgrade pip
          python3 -m pip install --index-url https://pypi.org/simple/ -r $TECHDOCS_CORE_PATH/requirements.txt

      - name: lint techdocs-core package
        run: |
          python3 -m black --check $TECHDOCS_CORE_PATH/src
