mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-08-28 13:24:09 +00:00
Bumps the actions group with 8 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `4` | `7` | | [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3` | `4` | | [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3` | `4` | | [docker/login-action](https://github.com/docker/login-action) | `3` | `4` | | [docker/metadata-action](https://github.com/docker/metadata-action) | `5` | `6` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `6` | `7` | | [actions/setup-python](https://github.com/actions/setup-python) | `5` | `7` | | [actions/setup-node](https://github.com/actions/setup-node) | `4` | `7` | Updates `actions/checkout` from 4 to 7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v7) Updates `docker/setup-qemu-action` from 3 to 4 - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/v3...v4) Updates `docker/setup-buildx-action` from 3 to 4 - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v3...v4) Updates `docker/login-action` from 3 to 4 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v3...v4) Updates `docker/metadata-action` from 5 to 6 - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/v5...v6) Updates `docker/build-push-action` from 6 to 7 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v6...v7) Updates `actions/setup-python` from 5 to 7 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v5...v7) Updates `actions/setup-node` from 4 to 7 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/setup-qemu-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/setup-buildx-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/login-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/metadata-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/build-push-action dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-python dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-node dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
166 lines
4.6 KiB
YAML
166 lines
4.6 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
- dev
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- master
|
|
- dev
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
lint-frontend:
|
|
name: Lint Frontend (HTMLHint + ESLint)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
|
|
- name: Install frontend lint tools
|
|
run: npm ci
|
|
|
|
- name: HTMLHint — lint HTML templates
|
|
run: npm run lint:html
|
|
|
|
- name: ESLint — lint inline JavaScript
|
|
run: npm run lint:js
|
|
|
|
lint-shell:
|
|
name: Lint Shell Scripts (ShellCheck)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Install ShellCheck
|
|
run: sudo apt-get install -y shellcheck
|
|
|
|
- name: ShellCheck — lint all .sh files
|
|
run: |
|
|
find . -name "*.sh" \
|
|
-not -path "./.git/*" \
|
|
-not -path "./node_modules/*" \
|
|
-not -path "./.venv/*" \
|
|
-not -path "./venv/*" \
|
|
-not -path "./dist/*" \
|
|
-print0 | xargs -0 shellcheck --severity=warning
|
|
|
|
lint:
|
|
name: Lint (ruff)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.11"
|
|
cache: pip
|
|
|
|
- name: Install ruff
|
|
run: pip install "ruff==0.15.15"
|
|
|
|
- name: ruff check — fail on any lint error
|
|
# Whole tree, not just modules/ and tests/: scripts/ and the root-level
|
|
# scripts (meshcore_bot.py, validate_config.py, generate_website.py, …)
|
|
# ship to users too. Excludes come from pyproject's [tool.ruff].
|
|
run: ruff check .
|
|
|
|
- name: Log injection check — fail on new unsanitized logger calls
|
|
run: python scripts/check_log_injection.py
|
|
|
|
- name: Config validation — fail on unrecognized sections in shipped configs
|
|
run: |
|
|
set -e
|
|
for f in config.ini.example config.ini.minimal-example config.ini.quickstart config.min.ini config-pymc.ini; do
|
|
if [ -f "$f" ]; then
|
|
echo "Validating $f"
|
|
python validate_config.py --config "$f" --strict
|
|
fi
|
|
done
|
|
|
|
typecheck:
|
|
name: Type check (mypy)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.11"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install -e ".[test,geo]"
|
|
pip install mypy
|
|
|
|
- name: mypy — strict overrides on typed modules
|
|
run: mypy modules/ --ignore-missing-imports
|
|
|
|
package:
|
|
name: Build and smoke-test distributions
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.11"
|
|
cache: pip
|
|
|
|
- name: Build wheel and source distribution
|
|
run: |
|
|
python -m pip install --upgrade pip build twine
|
|
python -m build
|
|
python -m twine check dist/*
|
|
|
|
- name: Install and smoke-test wheel outside the source tree
|
|
run: |
|
|
python -m venv /tmp/meshcore-wheel-smoke
|
|
/tmp/meshcore-wheel-smoke/bin/pip install dist/*.whl
|
|
cd /tmp
|
|
/tmp/meshcore-wheel-smoke/bin/python "$GITHUB_WORKSPACE/scripts/smoke_test_wheel.py"
|
|
/tmp/meshcore-wheel-smoke/bin/python "$GITHUB_WORKSPACE/scripts/smoke_test_no_geo.py"
|
|
/tmp/meshcore-wheel-smoke/bin/meshcore-bot --help >/dev/null
|
|
/tmp/meshcore-wheel-smoke/bin/meshcore-viewer --help >/dev/null
|
|
|
|
test:
|
|
name: Tests (Python ${{ matrix.python-version }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install --upgrade pip
|
|
# `geo` (us, pycountry) is optional at runtime but drives US state and
|
|
# country normalization; without it ~27 location tests skip and the AQI
|
|
# prefix-budget behavior silently differs from a real install.
|
|
pip install -e ".[test,geo]"
|
|
|
|
- name: Run tests with coverage
|
|
run: pytest tests/ -v --tb=short
|