Skip to content

Merge pull request #5 from lelutin/renovate/actions-setup-python-5.x #53

Merge pull request #5 from lelutin/renovate/actions-setup-python-5.x

Merge pull request #5 from lelutin/renovate/actions-setup-python-5.x #53

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on: [push, pull_request]
jobs:
# The code only needs to be linted against one python version. We'll use the
# latest one
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install flake8
run: |
python -m pip install --upgrade pip
python -m pip install .[lint]
- name: Display versions
run: |
python -c "import sys; print(sys.version)"
flake8 --version
- name: Lint with flake8
run: |
flake8 . --count --statistics
types:
# We only need to perform static type analysis on one version of python
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install mypy
run: |
python -m pip install --upgrade pip
python -m pip install .[types]
- name: Display versions
run: |
python -c "import sys; print(sys.version)"
mypy --version
- name: Static type analysis
run: |
mypy src/dns_deep_state tests/
test:
runs-on: ubuntu-latest
needs: types
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# This will install pytest
python -m pip install .[test]
- name: Test with pytest
run: |
pytest