Skip to content

Stac validation

Stac validation #34

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python unit tests
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache Poetry virtualenv
id: cache
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-#{{ hashFiles('**/poetry.lock') }}
- name: install pip
run: poetry run python -m pip install --upgrade pip
- name: Install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction
- name: Test with pytest
working-directory: ./tests
run: |
source ../.venv/bin/activate
pytest
- name: flake8 linter
run: |
source ./.venv/bin/activate
python -m flake8 --count --max-complexity 10 --ignore E501,W503 --show-source --statistics --exclude ./.venv .
- name: Run mypy
run: |
source ./.venv/bin/activate
pip install mypy
mypy --install-types --non-interactive --namespace-packages