-
-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add github flow for ci * Add runs-on to tests * Replace azure pipelines badge with github one, replace coveralls with codecov * Test pypy3 only on ubuntu
- Loading branch information
Showing
3 changed files
with
87 additions
and
134 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
workflow_dispatch: # to allow manual re-runs | ||
|
||
|
||
jobs: | ||
linting: | ||
name: "Perform linting checks" | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.9"] | ||
|
||
steps: | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-python@v2" | ||
with: | ||
python-version: "${{ matrix.python-version }}" | ||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip poetry | ||
poetry install --extras docs | ||
- name: "Code formating (black)" | ||
run: | | ||
poetry run pre-commit run black --all-files | ||
- name: "Code formating (flake8)" | ||
run: | | ||
poetry run pre-commit run flake8 --all-files | ||
- name: "Order of imports (isort)" | ||
run: | | ||
poetry run pre-commit run isort --all-files | ||
- name: "Docstring formating (docformatter)" | ||
run: | | ||
poetry run pre-commit run docformatter --all-files | ||
- name: "Potential security issues (bandit)" | ||
run: | | ||
poetry run pre-commit run bandit --all-files | ||
- name: "Documentation build (sphinx)" | ||
run: | | ||
poetry run sphinx-build docs/ generated_docs | ||
# - name: "Typing checks (mypy)" | ||
# run: | | ||
# poetry run pre-commit run mypy --all-files | ||
|
||
tests: | ||
name: "Python ${{ matrix.python-version}} on ${{ matrix.os }}" | ||
needs: linting | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
# test pypy3 only on ubuntu as cryptography requires rust compilation | ||
# which slows the pipeline and was not currently working on macos | ||
exclude: | ||
- python-version: pypy3 | ||
os: macos-latest | ||
- python-version: pypy3 | ||
os: windows-latest | ||
|
||
steps: | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-python@v2" | ||
with: | ||
python-version: "${{ matrix.python-version }}" | ||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip poetry | ||
poetry install --extras docs | ||
- name: "Run tests" | ||
run: | | ||
poetry run pytest --cov miio --cov-report xml | ||
- name: "Upload coverage to Codecov" | ||
uses: "codecov/codecov-action@v1" | ||
with: | ||
fail_ci_if_error: true |
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
This file was deleted.
Oops, something went wrong.