Type hints for operations #1228
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint & Test | |
on: | |
push: | |
branches: | |
- 2.x | |
- 1.x | |
- 0.x | |
pull_request: | |
jobs: | |
# Linting | |
# | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- run: pip install '.[test]' | |
- run: flake8 | |
type-check: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- run: pip install '.[test]' | |
- run: scripts/check-operation-stub-typing.sh | |
- run: mypy pyinfra pyinfra_cli | |
# Unit tests | |
# | |
unit-test: | |
needs: | |
- lint | |
- type-check | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, ubuntu-latest] | |
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] | |
include: | |
- os: macos-12 | |
python-version: "3.11" | |
- os: windows-2022 | |
python-version: "3.11" | |
exclude: | |
- os: ubuntu-latest | |
python-version: "3.6" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install '.[test]' | |
- run: pytest --cov --disable-warnings | |
- uses: codecov/codecov-action@v3 | |
# End-to-end tests | |
# | |
end-to-end-test: | |
needs: | |
- lint | |
- type-check | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, ubuntu-latest] | |
test-name: [local, ssh, docker] | |
include: | |
- os: macos-latest | |
test-name: local | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- run: pip install '.[test]' | |
- run: pytest -m end_to_end_${{ matrix.test-name }} | |
# Finally, single jon to check if all completed, for use in protected branch | |
# | |
tests-done: | |
if: ${{ always() }} | |
needs: | |
- lint | |
- type-check | |
- unit-test | |
- end-to-end-test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: matrix-org/done-action@v2 | |
with: | |
needs: ${{ toJSON(needs) }} |