Skip to content

Dashboard: "new release available" badge linking to the GitHub release (#224) #274

Dashboard: "new release available" badge linking to the GitHub release (#224)

Dashboard: "new release available" badge linking to the GitHub release (#224) #274

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
dashboard:
name: Dashboard tests (pytest + coverage)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dashboard with test extras
run: pip install -e "build/dashboard[test]"
- name: Run pytest with coverage gate
working-directory: build/dashboard
run: python -m pytest --cov=mining_dashboard --cov-report=term-missing --cov-fail-under=80
- name: Fake-daemon contract test (real clients vs controllable fakes)
# Points the real Monero/Tari clients at the integration fakes and asserts they parse
# every state (synced/syncing/down). Docker-free, so it runs on every PR (issue #54).
run: PYTHONPATH=build/dashboard python -m pytest tests/integration/fakes -q
frontend:
name: Frontend logic tests (node --test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
# Pure client logic (worker sort, tooltip formatting) lives in static/logic.mjs and is
# tested with Node's built-in runner — no package.json/node_modules/build step. Component
# rendering is covered by a manual browser smoke test, not here.
- name: Run frontend logic tests
run: node --test build/dashboard/tests/frontend/*.test.mjs
dashboard-image:
name: Dashboard image (Docker test stage)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the dashboard test stage (installs package + runs the suite in-container)
run: docker build --target test ./build/dashboard
build-images:
# Build every build/* image so a broken Dockerfile / COPY path / entrypoint / pinned-digest is
# caught in CI instead of at deploy time (#124). Previously only the dashboard test stage was
# built, so e.g. the Tor image's entrypoint restructure (#180) shipped with no CI safety net.
# Tari is an upstream image (no Dockerfile here), so it's excluded. fail-fast: false so one
# broken image doesn't hide the others; empty build-args keep the dashboard build working bare.
name: Build image (${{ matrix.service }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
service: [monero, p2pool, tor, xmrig-proxy, dashboard]
steps:
- uses: actions/checkout@v4
- name: docker build ./build/${{ matrix.service }}
run: docker build -t "pithead-${{ matrix.service }}:ci" "./build/${{ matrix.service }}"
hadolint:
name: Dockerfile lint (hadolint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install hadolint
run: |
sudo curl -fsSL -o /usr/local/bin/hadolint \
https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
sudo chmod +x /usr/local/bin/hadolint
- name: Lint all build/* Dockerfiles (config in .hadolint.yaml)
run: hadolint build/*/Dockerfile
shell:
name: Shell tests (shellcheck + pithead suite)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# shellcheck is preinstalled on ubuntu-* runners, so we invoke it directly.
# Avoid `apt-get update`, which refreshes every configured source (incl.
# unrelated third-party mirrors like dl.google.com) and intermittently fails
# the job when one is briefly out of sync — see issue #64.
- name: Lint pithead, build/* container scripts, and test scripts
# Single source of truth: the Makefile `lint` target (so the file list can't drift between
# here and `make lint`). Now also covers build/*/*.sh — the entrypoints + healthchecks that
# run in every container (#124). Gate on warnings+errors; info-level style nits vary by
# shellcheck version.
run: make lint
- name: Run pithead test suite
run: bash tests/stack/run.sh
- name: Run integration harness self-test
# Pure-logic checks for the tests/integration/ harness (config rendering, matrix
# coverage, redaction). The LIVE matrix (tests/integration/run.sh) needs a real test
# server and runs as a gated/manual release gate (#54), not on every PR.
run: bash tests/integration/selftest.sh
- name: Check the test inventory is up to date
# docs/test-inventory.md is generated from the suites; fail if a test was added/removed
# without regenerating it (run `make test-inventory`).
run: make test-inventory-check
compose:
name: Compose config + security hardening
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate docker-compose.yml interpolation + hardening invariants (#90)
run: bash tests/stack/test_compose.sh