Skip to content

ci: Let stable be the default on anta.ninja #260

ci: Let stable be the default on anta.ninja

ci: Let stable be the default on anta.ninja #260

Workflow file for this run

---
name: Linting and Testing Anta
on:
push:
branches:
- main
pull_request:
jobs:
check-requirements:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install requirements
run: |
pip install .
- name: install dev requirements
run: pip install .[dev]
lint-yaml:
name: Run linting for yaml files
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml
file_or_dir: .
lint-python:
name: Run isort, black, flake8 and pylint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install tox
- name: "Run tox linting environment"
run: tox -e lint
type-python:
name: Run mypy
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install tox
- name: "Run tox typing environment"
run: tox -e type
test-python:
name: Pytest across all supported python versions
runs-on: ubuntu-20.04
needs: [lint-python, type-python]
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox tox-gh-actions
- name: "Run pytest via tox for ${{ matrix.python }}"
run: tox
test-documentation:
name: Build offline documentation for testing
runs-on: ubuntu-20.04
needs: [lint-python, type-python, test-python]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: pip install .[doc]
- name: "Build mkdocs documentation offline"
run: mkdocs build