Files
meshcore-ansible/.gitea/workflows/ci.yml
T
tthandClaude Opus 5.5 0a4cfafc78
ci / test (push) Successful in 2m39s
tth.meshcore: MeshCore repeaters as code, over RF
Ansible collection that converges MeshCore repeaters through a companion
radio (TCP, USB serial or BLE): admin ACL, CLI prefs, region tree,
firmware facts, companion remote-CLI ACL, and the meshcore-tth extras
(BLE on/off and own BLE PIN, channel-hash filter, message age, advert
fairness). Every change is read, diffed, sent and read back; --check
only reads. ansible-test sanity, unit tests and a galaxy build in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 02:23:24 +01:00

71 lines
2.2 KiB
YAML

# Lint, ansible-test sanity, unit tests and a collection build on every push and PR.
name: ci
"on":
push:
pull_request:
workflow_dispatch:
env:
# renovate: datasource=pypi depName=ruff
RUFF_VERSION: "0.17.3"
# renovate: datasource=pypi depName=yamllint
YAMLLINT_VERSION: "1.38.0"
# renovate: datasource=pypi depName=ansible-core
ANSIBLE_CORE_VERSION: "2.22.0"
# renovate: datasource=pypi depName=meshcore
MESHCORE_VERSION: "2.3.17"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: gitleaks
uses: https://git.rfa.cz/tth-pub/ci-actions/gitleaks@v12
with:
mode: block
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install
run: |
set -euo pipefail
python -m pip install --quiet pytest "ansible-core==$ANSIBLE_CORE_VERSION" \
"meshcore==$MESHCORE_VERSION" "ruff==$RUFF_VERSION" "yamllint==$YAMLLINT_VERSION"
# Collection imports and ansible-test need the ansible_collections/<ns>/<name>
# layout, as a real directory (ansible-test resolves a symlinked cwd).
- name: Collection path
run: |
set -euo pipefail
mkdir -p "$RUNNER_TEMP/ac/ansible_collections/tth/meshcore"
cp -a . "$RUNNER_TEMP/ac/ansible_collections/tth/meshcore/"
- name: Lint
run: |
set -euo pipefail
ruff check .
ruff format --check .
yamllint .
- name: ansible-test sanity
run: |
set -euo pipefail
cd "$RUNNER_TEMP/ac/ansible_collections/tth/meshcore"
# the interpreter setup-python installed (ansible-test refuses others)
py=$(python -c 'import sys; print(f"{sys.version_info[0]}.{sys.version_info[1]}")')
ansible-test sanity --requirements --python "$py" --local --color no
- name: Tests
run: |
set -euo pipefail
cd "$RUNNER_TEMP/ac/ansible_collections/tth/meshcore"
PYTHONPATH="$RUNNER_TEMP/ac" python -m pytest -q -p no:cacheprovider tests/unit
- name: Build
run: ansible-galaxy collection build --force