Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/static-checks-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Static Checks Pull Request

on:
pull_request:
branches:
- main

jobs:
static-checks:
name: Run static tests using tox
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.12'

steps:
- name: Get Repository Code
id: get_repo_code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Run static checks
run: |
pip install tox
tox -c tests/static -- ${{ github.base_ref }} ${{ github.sha }}
...
34 changes: 34 additions & 0 deletions .github/workflows/static-checks-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Static Checks Push

on:
push:
branches:
- main
tags:
- v*

jobs:
static-checks:
name: Run static tests using tox
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.12'

steps:
- name: Get Repository Code
id: get_repo_code
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Run static checks
run: |
pip install tox
tox -c tests/static
...
20 changes: 20 additions & 0 deletions tests/static/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[run]
branch = True
omit =
*/lib/python*/site-packages/*
*/lib/python*/*
/usr/*
*/setup.py
# TODO(rhcarvalho): this is used to ignore test files from coverage report.
# We can make this less generic when we stick with a single test pattern in
# the repo.
*/conftest.py
*/test_*.py
*/*_tests.py
*/test/*

[report]
fail_under = 28

[html]
directory = cover
5 changes: 5 additions & 0 deletions tests/static/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
# TODO: cleanup flake8 issues with utils/test/*
exclude=.tox,inventory
max_line_length = 120
ignore = E501,T003
Loading