- .forgejo/workflows/ci.yml: npm run verify nel container Playwright a ogni push su main e pull request, report come artifact, link esterni non bloccanti - .forgejo/workflows/release.yml: ai tag vX.Y.Z verifica, pacchetto e pubblicazione nella sezione Release con forgejo-release (token FORGEJO_TOKEN) - scripts/package.mjs: zip e tar.gz riproducibili, SHA256SUMS.txt, BUILD-INFO.txt - scripts/check-package.mjs: confronto 1:1 con dist/, impronte, sha256sum -c - scripts/changelog-notes.mjs e release-upload.sh (API REST di Forgejo) - deploy/: nginx.conf.example, gestore PHP del modulo, esempio di deploy automatico (rsync, FTPS, rclone) non attivo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zJ9ZWGKvoKoxYwbmnRKdJ
93 lines
2.9 KiB
YAML
93 lines
2.9 KiB
YAML
# =============================================================================
|
|
# CI — verifica completa a ogni push su main e a ogni pull request.
|
|
#
|
|
# RUNNER: `runs-on: docker` è il label più comune di forgejo-runner. Se il runner
|
|
# dell'istanza usa un altro label (es. `ubuntu-latest`, `self-hosted`), sostituirlo
|
|
# in tutti i job: Impostazioni del repository → Actions → Runner mostra i label disponibili.
|
|
#
|
|
# CONTAINER: l'immagine Playwright DEVE avere la stessa versione di @playwright/test
|
|
# in package.json (oggi 1.56.1). Aggiornando Playwright, aggiornare anche qui e in release.yml.
|
|
#
|
|
# AZIONI: referenziate con URL completo su code.forgejo.org, così il workflow non dipende
|
|
# dall'impostazione DEFAULT_ACTIONS_URL dell'istanza.
|
|
#
|
|
# SEGRETI: questo workflow non ne usa. Il segreto facoltativo FORGEJO_TOKEN serve solo a
|
|
# release.yml (vedi il commento in quel file e il README).
|
|
# =============================================================================
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
ASTRO_TELEMETRY_DISABLED: '1'
|
|
CI: 'true'
|
|
|
|
jobs:
|
|
verify:
|
|
name: Verifica (lint, build, test, Lighthouse)
|
|
runs-on: docker # label del runner: adattare (es. ubuntu-latest)
|
|
container:
|
|
image: mcr.microsoft.com/playwright:v1.56.1-noble # = versione di @playwright/test
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
|
|
- uses: https://code.forgejo.org/actions/setup-node@v4
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: npm
|
|
|
|
- name: Dipendenze
|
|
run: npm ci
|
|
|
|
- name: npm run verify
|
|
run: npm run verify
|
|
|
|
- name: Report Playwright (solo in caso di errore)
|
|
if: failure()
|
|
uses: https://code.forgejo.org/actions/upload-artifact@v3 # usare @v4 se l'istanza Forgejo lo supporta
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report
|
|
retention-days: 14
|
|
|
|
- name: Report Lighthouse
|
|
if: always()
|
|
uses: https://code.forgejo.org/actions/upload-artifact@v3
|
|
with:
|
|
name: lighthouse
|
|
path: .lighthouseci
|
|
retention-days: 14
|
|
|
|
- name: Artifact dist
|
|
uses: https://code.forgejo.org/actions/upload-artifact@v3
|
|
with:
|
|
name: dist
|
|
path: dist
|
|
retention-days: 7
|
|
|
|
external-links:
|
|
name: Link esterni (non bloccante)
|
|
runs-on: docker # label del runner: adattare (es. ubuntu-latest)
|
|
container:
|
|
image: node:24
|
|
continue-on-error: true # dipende dalla rete del runner e dai siti esterni
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
|
|
- name: Dipendenze
|
|
run: npm ci
|
|
env:
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Controllo dei link esterni
|
|
run: npm run test:links -- --external
|