From 266aadf63503286b8ea694230dc24b1d2914b0c4 Mon Sep 17 00:00:00 2001 From: Kamil Krzywda Date: Wed, 23 Sep 2026 21:53:57 +0200 Subject: [PATCH] ci: Gitea Actions test pipeline (v0.1.2) (#4) ci: Gitea Actions test pipeline (v0.1.2) --- .gitea/workflows/ci.yml | 69 +++++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 4 +++ package.json | 2 +- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..f8c6f28 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + ci: + name: build + unit + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + # The runner provides a working docker CLI out of the box (full-dind) — no endpoint + # resolution needed, same as flight's CI. + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + + # Job-level dep cache via the runner's built-in cache server. continue-on-error: an + # unreachable/broken cache server must never break the run (flight convention). npm ci + # wipes node_modules, so cache npm's own tarball store instead — restoring node_modules + # would just be deleted again. No explicit save step: caches marked by the restore step + # are uploaded automatically at job end. + - name: Restore deps cache + uses: actions/cache@v4 + continue-on-error: true + with: + path: $HOME/.npm + key: ${{ runner.os }}-deps-npm-${{ hashFiles('package-lock.json') }} + + # Retried: the runner's outbound network/DNS is flaky (transient EAI_AGAIN seen in CI). + - name: Install dependencies + run: | + set -u + ok=0 + for i in 1 2 3; do + if npm ci; then ok=1; break; fi + echo "::warning::dependency install attempt $i/3 failed (likely transient network) — retrying in 5s" >&2 + sleep 5 + done + [ "$ok" = "1" ] || { echo "::error::dependency install failed after 3 attempts" >&2; exit 1; } + + - name: Build + run: npm run build + + # vitest auto-appends results to $GITHUB_STEP_SUMMARY when GITHUB_ACTIONS=true — no + # extra summary step needed (same as flight relies on for its unit stage). + - name: Unit tests + run: npm test + + # Verifies the production Dockerfile builds — the deploy path is `docker compose up -d --build`. + # Build only, nothing runs, so no cleanup/prune steps are needed (unlike flight's e2e stack). + # Retried: same flaky runner network as dep install. + - name: Docker image build + run: | + set -u + ok=0 + for i in 1 2 3; do + if docker compose build --progress=plain; then ok=1; break; fi + echo "::warning::docker build attempt $i/3 failed (likely transient network) — retrying in 5s" >&2 + sleep 5 + done + [ "$ok" = "1" ] || { echo "::error::docker image build failed after 3 attempts" >&2; exit 1; } diff --git a/CHANGELOG.md b/CHANGELOG.md index f78fa02..82da04e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v0.1.2 — 2026-09-23 19:51 + +- Added a Gitea Actions CI pipeline (`.gitea/workflows/ci.yml`), mirroring flight's runner conventions: on push/PR to `main` (plus manual dispatch) one job runs `npm ci`, `nest build`, the vitest unit suite, and a production Docker image build — with retry loops for the runner's flaky uplink. No app code changed. + ## v0.1.1 — 2026-09-23 19:38 - Fixed the default bridge port to `4403`, the meshtastic-serial-bridge's actual TCP port (the old value pointed at a closed port). Updated the `MESH_PORT` default in code, the docker-compose environment, and docs. diff --git a/package.json b/package.json index 797d003..7799886 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mesh-bot", - "version": "0.1.1", + "version": "0.1.2", "description": "", "author": "", "private": true,