Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Basic CI and Tox #6

Merged
merged 3 commits into from
Jun 16, 2024
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
49 changes: 49 additions & 0 deletions .github/workflows/gate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Gating"
on:
push:
branches: [ "main", "*" ]
pull_request:
branches: [ "main" ]

jobs:
test-fedora-latest:
runs-on: "ubuntu-latest"
container:
image: fedora:latest
steps:
- name: Install Dependencies
run: dnf install -y python3-devel python3-setuptools
- name: Checkout
uses: actions/checkout@v4
- name: Install Python Dependencies
run: pip install -r requirements.txt
- name: Run all tests
run: tox

test-fedora-rawhide:
runs-on: "ubuntu-latest"
container:
image: fedora:rawhide
steps:
- name: Install Dependencies
run: dnf install -y python3-devel python3-setuptools
- name: Checkout
uses: actions/checkout@v4
- name: Install Python Dependencies
run: pip install -r requirements.txt
- name: Run all tests
run: tox

test-c10s:
runs-on: "ubuntu-latest"
container:
image: quay.io/centos/centos:stream10-development
steps:
- name: Install Dependencies
run: dnf install -y python3-devel python3-setuptools
- name: Checkout
uses: actions/checkout@v4
- name: Install Python Dependencies
run: pip install -r requirements.txt
- name: Run all tests
run: tox
2 changes: 1 addition & 1 deletion compliance_tool/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def prepare_parsers() -> argparse.ArgumentParser:
return parser


def main():
def main() -> int:
args = prepare_parsers().parse_args()
args.func(args)
return 0
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tox>=4
setuptools>=61.0
26 changes: 26 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
[tox]
requires =
tox>=4
env_list = lint, type, py

[testenv:lint]
description = run linters
skip_install = true
deps =
pycodestyle==2.11.1
commands = pycodestyle {posargs:compliance_tool}

[testenv:type]
description = run type checks
skip_install = true
deps =
mypy==1.10.0
commands = mypy {posargs:compliance_tool}

[testenv:docs]
basepython = python
changedir = docs
deps = -r docs/requirements.txt
allowlist_externals = sphinx-build
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[pycodestyle]
max-line-length = 99