diff --git a/.github/workflows/gate.yaml b/.github/workflows/gate.yaml new file mode 100644 index 0000000..2e7cb26 --- /dev/null +++ b/.github/workflows/gate.yaml @@ -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 diff --git a/compliance_tool/cli.py b/compliance_tool/cli.py index 9916cc1..389dc87 100644 --- a/compliance_tool/cli.py +++ b/compliance_tool/cli.py @@ -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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..10001ec --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +tox>=4 +setuptools>=61.0 diff --git a/tox.ini b/tox.ini index 8cb60e1..096a4b2 100644 --- a/tox.ini +++ b/tox.ini @@ -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