forked from ocf/transpire
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: reimport old tests + add linting setup
- Loading branch information
Showing
7 changed files
with
622 additions
and
68 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
extend-ignore = E203, E501 | ||
extend-ignore = E203, E501 |
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,52 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [main] | ||
tags: | ||
- v* | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade poetry | ||
poetry --version | ||
poetry install --no-interaction | ||
- name: Lint | ||
run: poetry run pre-commit run --all-files | ||
|
||
test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade poetry | ||
poetry --version | ||
poetry install --no-interaction | ||
- name: Test | ||
run: poetry run coverage run -m pytest | ||
|
||
- name: Prepare coverage report | ||
run: poetry run coverage xml | ||
|
||
- name: Upload coverage reports | ||
uses: codecov/codecov-action@v2 |
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 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,41 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: name-tests-test | ||
- repo: local | ||
# run all of these hooks from the Poetry versions | ||
hooks: | ||
- id: isort | ||
name: isort | ||
entry: poetry run isort | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
- id: black | ||
name: black | ||
entry: poetry run black | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
- id: flake8 | ||
name: flake8 | ||
entry: poetry run flake8 | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
- id: mypy | ||
name: mypy | ||
entry: poetry run mypy | ||
args: ["--scripts-are-modules"] | ||
language: system | ||
types: [python] | ||
require_serial: true |
Oops, something went wrong.