ci: expand pull request validation

This commit is contained in:
yellowcooln committed 2026-09-02 16:22:05 -04:00
1 parent f665237825
commit 1d5b8f8537
4 files changed
+134 -5

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
name: Container Checks
on:
pull_request:
paths:
- dockerfile
- .dockerignore
- docker-compose.yml
- docker-compose.build.yml
- docker-entrypoint.sh
- .github/workflows/container-checks.yml
workflow_dispatch:
concurrency:
group: container-checks-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check Dockerfile
run: docker buildx build --check -f dockerfile .
- name: Check Compose configuration
run: docker compose -f docker-compose.yml -f docker-compose.build.yml config --quiet
- name: Lint Dockerfile
run: docker run --rm -i hadolint/hadolint:v2.15.1 hadolint --failure-threshold error - < dockerfile
+96 -1
View File
@@ -34,4 +34,99 @@ jobs:
python -m pip install -e .[dev]
- name: Run pre-commit
run: pre-commit run --all-files
run: pre-commit run --all-files
python-310:
name: Python 3.10
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: Run tests
run: python -m pytest -q
repository-lint:
name: Actions and shell scripts
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint GitHub Actions workflows
run: docker run --rm -v "$PWD:/repo" -w /repo rhysd/actionlint:1.7.12
- name: Check shell scripts
run: |
git ls-files -z '*.sh' | xargs -0 --no-run-if-empty \
docker run --rm -v "$PWD:/mnt" -w /mnt \
koalaman/shellcheck:v0.11.0 --severity=error
package-smoke:
name: Wheel smoke test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Build wheel
run: |
python -m pip install --upgrade pip build
rm -rf build dist ./*.egg-info
python -m build --wheel
- name: Install wheel
run: python -m pip install dist/*.whl
- name: Verify installed package
run: |
python - <<'PY'
from importlib.metadata import entry_points
from importlib.resources import files
package = files("repeater")
required = (
"web/openapi.yaml",
"web/html/index.html",
"presets/letsmesh.yaml",
)
missing = [path for path in required if not package.joinpath(path).is_file()]
if missing:
raise SystemExit(f"Missing packaged files: {', '.join(missing)}")
scripts = {ep.name for ep in entry_points(group="console_scripts")}
expected = {"openhop-repeater", "pymc-cli"}
if missing_scripts := expected - scripts:
raise SystemExit(f"Missing console scripts: {', '.join(sorted(missing_scripts))}")
PY
openhop-repeater --help
+1 -1
View File
@@ -46,7 +46,7 @@ repos:
hooks:
- id: openapi-contract-check
name: OpenAPI contract check
entry: python scripts/check_openapi_contract.py
entry: python scripts/check_openapi_contract.py --strict-methods
language: python
additional_dependencies: [PyYAML]
pass_filenames: false
+2 -3
View File
@@ -11,14 +11,13 @@ authors = [
description = "PyMC Repeater Daemon"
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.9"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
@@ -79,7 +78,7 @@ repeater = [
[tool.ruff]
line-length = 100
target-version = "py39"
target-version = "py310"
[tool.ruff.lint]
extend-ignore = ["E701"]