facts/server: add RebootRequired
fact for detecting system reboot n…
#2008
This file contains hidden or 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: | |
- 3.x | |
- 2.x | |
- 1.x | |
- 0.x | |
pull_request: | |
jobs: | |
# Linting | |
# | |
lint: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- run: pip install '.[test]' | |
- run: flake8 | |
type-check: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- run: pip install '.[test]' | |
- run: mypy | |
spell-check: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check spelling | |
uses: crate-ci/[email protected] | |
# Test instal works on untestable Python versions. This came about because click decided to drop | |
# Python 3.9 support before EOL, so 3.9 was dropped from the unit test matrix. Still need to test | |
# that pyinfra can be built on 3.9. | |
build-legacy-versions: | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install '.' | |
- run: pyinfra --help | |
# Unit tests | |
# | |
unit-test: | |
needs: | |
- lint | |
- type-check | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15,windows-2022, windows-2025] | |
python-version: ["3.10", "3.11", "3.12"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install '.[test]' | |
- run: pytest --cov --disable-warnings | |
- name: Upload coverage report to codecov | |
if: ${{ matrix.os == 'ubuntu-24.04' && matrix.python-version == '3.12' }} | |
uses: codecov/codecov-action@v5 | |
# End-to-end tests | |
# | |
end-to-end-test: | |
needs: | |
- lint | |
- type-check | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, ubuntu-24.04] | |
test-name: [local, ssh, docker, podman] | |
python-version: ["3.10", "3.11", "3.12"] | |
include: | |
- os: macos-13 | |
test-name: local | |
python-version: "3.12" | |
- os: macos-14 | |
test-name: local | |
python-version: "3.12" | |
- os: macos-15 | |
test-name: local | |
python-version: "3.12" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- 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@v3 | |
with: | |
needs: ${{ toJSON(needs) }} |