Add CI/CD with Forgejo Actions + unit tests #1

Merged
edson merged 4 commits from ci-cd into main 2026-08-13 15:29:28 +00:00
Owner

Adds Forgejo Actions CI/CD and a small unit-test layer.

Workflows:

  • .forgejo/workflows/ci.yml — runs on PRs and pushes to main: a test job (Node 24, npm ci --ignore-scripts, node --check on all JS, npm test) and a build job (docker build smoke check).
  • .forgejo/workflows/release.yml — on push to main and tags v*: builds the image and pushes to the Forgejo container registry (git.edsonph.uk/edson/yt-downloader), tagged :latest + : (+ :$REF_NAME on tags). Logs in with the auto $GITHUB_TOKEN.

Tests & refactor:

  • Extracted sanitizeFilename + friendlyError from server.js into lib/utils.js.
  • test/ytdlp.test.js + test/utils.test.js — 14 network-free node:test units.
  • lib/ytdlp.js: exported langOrder; srtToText strips VTT Kind:/Language: header lines.
  • package.json: added "test": "node --test".

Notes:

  • Requires a registered runner with a docker label; Docker jobs need container.docker_host: 'automount' (or DIND/LXC).
  • If the auto token can't push to the container registry, a PAT with package-write scope may be needed as an Action secret.

Local checks: npm test 14/14 pass, node --check clean, both workflow YAMLs parse.

Adds Forgejo Actions CI/CD and a small unit-test layer. Workflows: - .forgejo/workflows/ci.yml — runs on PRs and pushes to main: a test job (Node 24, npm ci --ignore-scripts, node --check on all JS, npm test) and a build job (docker build smoke check). - .forgejo/workflows/release.yml — on push to main and tags v*: builds the image and pushes to the Forgejo container registry (git.edsonph.uk/edson/yt-downloader), tagged :latest + :<short-sha> (+ :$REF_NAME on tags). Logs in with the auto $GITHUB_TOKEN. Tests & refactor: - Extracted sanitizeFilename + friendlyError from server.js into lib/utils.js. - test/ytdlp.test.js + test/utils.test.js — 14 network-free node:test units. - lib/ytdlp.js: exported langOrder; srtToText strips VTT Kind:/Language: header lines. - package.json: added "test": "node --test". Notes: - Requires a registered runner with a docker label; Docker jobs need container.docker_host: 'automount' (or DIND/LXC). - If the auto token can't push to the container registry, a PAT with package-write scope may be needed as an Action secret. Local checks: npm test 14/14 pass, node --check clean, both workflow YAMLs parse.
Add CI/CD with Forgejo Actions, tests, and extract testable helpers
Some checks failed
CI / test (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
693609dc53
Install Docker CLI in build/release jobs
All checks were successful
CI / test (pull_request) Successful in 28s
CI / build (pull_request) Successful in 1m5s
90d6275ca6
ci: re-run after runner config fix
All checks were successful
CI / test (pull_request) Successful in 26s
CI / build (pull_request) Successful in 14s
ff73b5e7b3
Use REGISTRY_TOKEN secret for container registry login
All checks were successful
CI / test (pull_request) Successful in 6s
CI / build (pull_request) Successful in 13s
8cdee998f9
edson merged commit 57b8a43c50 into main 2026-08-13 15:29:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
edson/yt-downloader!1
No description provided.