# Verification: at every push on any branch (tags are taken by rilascio.yml) and by hand (Actions ▸ verifica ▸ Esegui). # Its four jobs are the checks required to merge into main (docs/processo.md): # controlli script syntax, workflows in block YAML and without actions, conflict markers, version, projects of # the solution, JSON; secrets in the whole history with gitleaks (version and hash pinned); # prove build of the whole solution with warnings as errors and all the tests of tests/Febe.Tests (never # «dotnet test» on the whole solution: tests/Febe.Tests.Windows runs only on Windows) with real # Chromium and Xvfb in a Debian 13 container: no test may be skipped, except the «da fare» ones of # H264ConformanceTests.FeaturesStillToDo (riepilogo-prove.sh counts them apart). # The synthetic world of the test site has seed 13 and, for the SitoDiProva category, also the seed of # this run, written in the log to reproduce a failure; # installatore Febe-Setup--ci..exe (our own installer, src/Febe.Installer) and the portable zip; # only the .NET SDK is needed; # immagine after the installer: the Docker image built with buildx, tested without network (start, health, # Chromium, it_IT) and scanned with Trivy (it stops for a CRITICAL with a fix); only after a push on # main it publishes it as :main and :sha-<7 characters> (:latest is left to the release). At the end, # always, it removes this run's images, containers, cache and builder, then the unnamed images and the # dangling build cache unused for 24 hours of all the daemon's projects. # # No actions (decision of Alberto of 18 November 2026: no external components): every step is a command. The sources # arrive with git and the job token, the .NET SDK with .gitea/scripts/dotnet.sh (verified against the hash in # Microsoft's metadata), the buildx builder with costruisci-immagine.sh builder. The artifacts (test results, # installer and zip, gitleaks and Trivy reports) go to Gitea's package registry, generic package febe-ci, version # -ci., with REGISTRY_TOKEN (.gitea/scripts/artefatti.sh); the Monday cleanup removes those older # than 14 days. Without the secret a warning, and the job stays green. No step uses Node. # # No «pull_request»: in Gitea a pull request shows the status of its last commit, which the branch push has already # verified; pull_request would redo everything on the same commit (refs/pull/N/head) on the only runner. # Runner: act_runner with the ubuntu-latest label, one job at a time. The jobs talk to the server's Docker daemon, the # same as Encelado, Mimante and the other projects: no mounts of the job folder into other containers (on the server # the paths are different); images travel as archives and build contexts. # What of Gitea 28 is used and why: docs/decisioni.md (20 October and 18 November 2026) and docs/processo.md. name: verifica on: push: branches: ["**"] workflow_dispatch: inputs: seme: description: "Seme del mondo sintetico per la seconda passata delle prove (vuoto: 1000 più il numero dell'esecuzione)" required: false default: "" permissions: contents: read # On a branch the last push counts: the earlier run is cancelled. On main every commit has its own group, so every # merge runs to the end and publishes its :sha-. The event is part of the group: a run by hand never cancels the one # of a push, which is the only one that writes the commit statuses required to merge (a cancelled job leaves the # «failure» status, and workflow_dispatch writes none). concurrency: group: verifica-${{ gitea.event_name }}-${{ gitea.ref }}${{ gitea.ref == 'refs/heads/main' && format('-{0}', gitea.sha) || '' }} cancel-in-progress: ${{ gitea.ref != 'refs/heads/main' }} defaults: run: shell: bash env: DOTNET_NOLOGO: "1" DOTNET_CLI_TELEMETRY_OPTOUT: "1" DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1" jobs: controlli: runs-on: ubuntu-latest timeout-minutes: 10 env: NUMERO: ${{ gitea.run_number }} steps: # The commit's sources with git and the job token, which is valid only while the job runs and does not stay in # the repository configuration. Here the whole history (PROFONDITA 0): gitleaks reads every commit the verified # one descends from. The same step, letter for letter, opens every job (PipelineTests checks it). - name: Sorgenti env: TOKEN: ${{ gitea.token }} SERVER: ${{ gitea.server_url }} REPOSITORY: ${{ gitea.repository }} PROFONDITA: "0" run: | git config --global --add safe.directory "$PWD" git init -q . git remote add origin "$SERVER/$REPOSITORY.git" 2> /dev/null || git remote set-url origin "$SERVER/$REPOSITORY.git" GIT_CONFIG_VALUE_0="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=http.extraHeader GIT_CONFIG_VALUE_0 profondita=() [ "$PROFONDITA" = 0 ] || profondita=(--depth "$PROFONDITA") if ! git fetch -q --no-tags "${profondita[@]}" origin "$GITHUB_SHA"; then echo "Il server non dà il commit per identificativo: prendo $GITHUB_REF con tutta la storia." git fetch -q --no-tags origin "+$GITHUB_REF:refs/remotes/origin/lavoro" fi git checkout -q --force --detach "$GITHUB_SHA" git log -1 --format='Commit %h: %s' - name: Script, flussi, conflitti, versione, soluzione e JSON run: bash .gitea/scripts/controlli.sh - name: Segreti in tutta la storia (gitleaks) run: bash .gitea/scripts/segreti.sh out/sicurezza - name: Rapporto di gitleaks (segreti oscurati, pacchetto febe-ci) if: failure() env: REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} GITEA_URL: ${{ gitea.server_url }} PROPRIETARIO: ${{ gitea.repository_owner }} run: | [ -f out/sicurezza/gitleaks.json ] || { echo "Nessun rapporto di gitleaks."; exit 0; } bash .gitea/scripts/artefatti.sh verifica out/sicurezza/gitleaks.json prove: needs: controlli runs-on: ubuntu-latest timeout-minutes: 60 # Debian 13, nothing else: the distribution's real Chromium, as in the Febe image (on Ubuntu it is a snap). Without # actions Node is not needed: git and curl before the sources, the rest from ambiente-prove.sh, the SDK from # dotnet.sh. Shared memory larger than the default 64 MB: the interface tests use a Chromium without a window. container: image: debian:trixie options: --shm-size=1g env: FEBE_CHROMIUM: /usr/bin/chromium SEME_RICHIESTO: ${{ gitea.event.inputs.seme }} NUMERO: ${{ gitea.run_number }} steps: - name: Git e curl per i sorgenti run: | export DEBIAN_FRONTEND=noninteractive apt-get update -qq apt-get install -y -qq --no-install-recommends git curl ca-certificates > /dev/null git --version - name: Sorgenti env: TOKEN: ${{ gitea.token }} SERVER: ${{ gitea.server_url }} REPOSITORY: ${{ gitea.repository }} PROFONDITA: "1" run: | git config --global --add safe.directory "$PWD" git init -q . git remote add origin "$SERVER/$REPOSITORY.git" 2> /dev/null || git remote set-url origin "$SERVER/$REPOSITORY.git" GIT_CONFIG_VALUE_0="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=http.extraHeader GIT_CONFIG_VALUE_0 profondita=() [ "$PROFONDITA" = 0 ] || profondita=(--depth "$PROFONDITA") if ! git fetch -q --no-tags "${profondita[@]}" origin "$GITHUB_SHA"; then echo "Il server non dà il commit per identificativo: prendo $GITHUB_REF con tutta la storia." git fetch -q --no-tags origin "+$GITHUB_REF:refs/remotes/origin/lavoro" fi git checkout -q --force --detach "$GITHUB_SHA" git log -1 --format='Commit %h: %s' # Before everything else, so that a wrong seed asked by hand stops the job at once. - name: Semi del mondo sintetico id: semi run: | seme="${SEME_RICHIESTO:-}" [ -n "$seme" ] || seme=$((1000 + ${NUMERO:-0})) if ! [[ "$seme" =~ ^-?[0-9]{1,9}$ ]]; then echo "Seme non valido: «$seme» (serve un intero di al massimo nove cifre)." >&2 exit 1 fi echo "seme=$seme" >> "$GITHUB_OUTPUT" echo "Mondo sintetico: seme 13 per tutte le prove, seme $seme per la seconda passata (categoria SitoDiProva)." echo "Per rifarla: FEBE_SEME_PROVA=$seme dotnet test tests/Febe.Tests --filter \"TestCategory=SitoDiProva\"" - name: Chromium, Xvfb e lingua italiana run: bash .gitea/scripts/ambiente-prove.sh - name: SDK .NET 10 run: bash .gitea/scripts/dotnet.sh 10.0 - name: Compilazione di tutta la soluzione (avvisi = errori) run: dotnet build Febe.slnx -c Release -nologo -warnaserror - name: Prove, seme 13 run: >- dotnet test tests/Febe.Tests -c Release --no-build --nologo --logger "trx;LogFileName=prove-seme-13.trx" --results-directory out/prove - name: Prove del sito di prova, seme dell'esecuzione if: ${{ !cancelled() && steps.semi.outputs.seme != '' }} env: FEBE_SEME_PROVA: ${{ steps.semi.outputs.seme }} run: >- dotnet test tests/Febe.Tests -c Release --no-build --nologo --filter "TestCategory=SitoDiProva" --logger "trx;LogFileName=prove-seme-$FEBE_SEME_PROVA.trx" --results-directory out/prove - name: Riepilogo delle prove if: ${{ !cancelled() }} run: bash .gitea/scripts/riepilogo-prove.sh out/prove 0 - name: Risultati delle prove (pacchetto febe-ci) if: ${{ !cancelled() }} env: REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} GITEA_URL: ${{ gitea.server_url }} PROPRIETARIO: ${{ gitea.repository_owner }} run: | shopt -s nullglob risultati=(out/prove/*.trx) ((${#risultati[@]} > 0)) || { echo "::warning::Nessun risultato delle prove da conservare."; exit 0; } bash .gitea/scripts/artefatti.sh verifica "${risultati[@]}" installatore: needs: prove runs-on: ubuntu-latest timeout-minutes: 30 env: NUMERO: ${{ gitea.run_number }} # This job runs on the runner image, which does not guarantee ICU: publishing and packaging do not need it, so # .NET goes into invariant globalization instead of stopping («Couldn't find a valid ICU package»). DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: "true" steps: - name: Sorgenti env: TOKEN: ${{ gitea.token }} SERVER: ${{ gitea.server_url }} REPOSITORY: ${{ gitea.repository }} PROFONDITA: "1" run: | git config --global --add safe.directory "$PWD" git init -q . git remote add origin "$SERVER/$REPOSITORY.git" 2> /dev/null || git remote set-url origin "$SERVER/$REPOSITORY.git" GIT_CONFIG_VALUE_0="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=http.extraHeader GIT_CONFIG_VALUE_0 profondita=() [ "$PROFONDITA" = 0 ] || profondita=(--depth "$PROFONDITA") if ! git fetch -q --no-tags "${profondita[@]}" origin "$GITHUB_SHA"; then echo "Il server non dà il commit per identificativo: prendo $GITHUB_REF con tutta la storia." git fetch -q --no-tags origin "+$GITHUB_REF:refs/remotes/origin/lavoro" fi git checkout -q --force --detach "$GITHUB_SHA" git log -1 --format='Commit %h: %s' - name: SDK .NET 10 run: bash .gitea/scripts/dotnet.sh 10.0 - name: Febe.exe, programma di installazione e zip portabile (versione di prova) run: | V=$(sed -n 's:.*\(.*\).*:\1:p' Directory.Build.props | head -n 1) echo "Versione di questa esecuzione: $V-ci.$NUMERO" bash installer/costruisci.sh "$V-ci.$NUMERO" - name: Artefatti per Windows (pacchetto febe-ci) env: REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} GITEA_URL: ${{ gitea.server_url }} PROPRIETARIO: ${{ gitea.repository_owner }} run: | shopt -s nullglob artefatti=(out/Febe-Setup-*.exe out/Febe-*-portabile.zip) ((${#artefatti[@]} == 2)) || { echo "Servono il programma di installazione e lo zip portabile, non: ${artefatti[*]:-niente}." >&2; exit 1; } bash .gitea/scripts/artefatti.sh verifica "${artefatti[@]}" # After the installer, not only after the tests: :main and :sha- come only from a commit with the whole verification # green. On the only runner the jobs go one at a time anyway, so the duration does not change. immagine: needs: [prove, installatore] runs-on: ubuntu-latest timeout-minutes: 60 env: FLUSSO: verifica ESECUZIONE: ${{ gitea.run_id }} NUMERO: ${{ gitea.run_number }} BUILDER: febe-ci-${{ gitea.run_id }} PROVA: febe-ci:${{ gitea.run_id }} steps: - name: Sorgenti env: TOKEN: ${{ gitea.token }} SERVER: ${{ gitea.server_url }} REPOSITORY: ${{ gitea.repository }} PROFONDITA: "1" run: | git config --global --add safe.directory "$PWD" git init -q . git remote add origin "$SERVER/$REPOSITORY.git" 2> /dev/null || git remote set-url origin "$SERVER/$REPOSITORY.git" GIT_CONFIG_VALUE_0="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=http.extraHeader GIT_CONFIG_VALUE_0 profondita=() [ "$PROFONDITA" = 0 ] || profondita=(--depth "$PROFONDITA") if ! git fetch -q --no-tags "${profondita[@]}" origin "$GITHUB_SHA"; then echo "Il server non dà il commit per identificativo: prendo $GITHUB_REF con tutta la storia." git fetch -q --no-tags origin "+$GITHUB_REF:refs/remotes/origin/lavoro" fi git checkout -q --force --detach "$GITHUB_SHA" git log -1 --format='Commit %h: %s' # What an interrupted run (cancelled, timed out) could not remove, and an earlier attempt of this same run. - name: Resti di esecuzioni interrotte run: | bash .gitea/scripts/pulizia-docker.sh residui 90 bash .gitea/scripts/pulizia-docker.sh esecuzione "$ESECUZIONE" # Registry: the REGISTRY variable of the Actions, if set, otherwise the host of the server address (ROOT_URL). - name: Versione, registro e nomi env: REGISTRO_SCELTO: ${{ vars.REGISTRY }} SERVER: ${{ gitea.server_url }} PROPRIETARIO: ${{ gitea.repository_owner }} run: | V=$(sed -n 's:.*\(.*\).*:\1:p' Directory.Build.props | head -n 1) REGISTRY="$REGISTRO_SCELTO" [ -n "$REGISTRY" ] || REGISTRY=$(echo "$SERVER" | sed -E 's#^https?://##; s#/.*$##') OWNER=$(echo "$PROPRIETARIO" | tr '[:upper:]' '[:lower:]') { echo "VERSIONE=$V-ci.$NUMERO" echo "GIT_COMMIT=${GITHUB_SHA::12}" echo "REGISTRY=$REGISTRY" echo "IMAGE=$REGISTRY/$OWNER/febe" echo "ARCHIVIO=${RUNNER_TEMP:-/tmp}/febe-$ESECUZIONE.tar" } >> "$GITHUB_ENV" echo "Immagine $V-ci.$NUMERO del commit ${GITHUB_SHA::12}, provata come $PROVA; registro $REGISTRY/$OWNER/febe" # A buildx builder of this run (with its cache), which knows that the home registry answers in HTTP. - name: Builder buildx dell'esecuzione run: bash .gitea/scripts/costruisci-immagine.sh builder "$REGISTRY" - name: Costruzione dell'immagine (dentro girano compilazione e prove) run: | bash .gitea/scripts/costruisci-immagine.sh archivio "$ARCHIVIO" "$PROVA" docker load -i "$ARCHIVIO" - name: Prova del contenitore, senza rete run: bash .gitea/scripts/prova-immagine.sh "$PROVA" "$ESECUZIONE" - name: Vulnerabilità dell'immagine (Trivy) run: bash .gitea/scripts/scansione-immagine.sh "$ARCHIVIO" out/sicurezza - name: Rapporto di Trivy (pacchetto febe-ci) if: ${{ !cancelled() }} env: REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} GITEA_URL: ${{ gitea.server_url }} PROPRIETARIO: ${{ gitea.repository_owner }} run: | [ -f out/sicurezza/trivy.json ] || { echo "Nessun rapporto di Trivy."; exit 0; } bash .gitea/scripts/artefatti.sh verifica out/sicurezza/trivy.json - name: Pubblicare? id: segreto env: TOKEN: ${{ secrets.REGISTRY_TOKEN }} EVENTO: ${{ gitea.event_name }} RIFERIMENTO: ${{ gitea.ref }} run: | if [ "$EVENTO" != push ] || [ "$RIFERIMENTO" != refs/heads/main ]; then echo "Si pubblica solo dopo un push su main: qui l'immagine è costruita, provata e scansionata." echo "presente=no" >> "$GITHUB_OUTPUT" elif [ -z "$TOKEN" ]; then echo "::warning::Manca il segreto REGISTRY_TOKEN: l'immagine di main è costruita, provata e scansionata ma non pubblicata. Aggiungilo (token con package: read and write) e rilancia la verifica di questo commit." echo "presente=no" >> "$GITHUB_OUTPUT" else echo "presente=si" >> "$GITHUB_OUTPUT" fi - name: Pubblicazione come :main e :sha- if: steps.segreto.outputs.presente == 'si' env: REGISTRO_TOKEN: ${{ secrets.REGISTRY_TOKEN }} REGISTRO_UTENTE: ${{ gitea.actor }} GITEA_TOKEN: ${{ gitea.token }} run: | # costruisci-immagine.sh pubblica puts the credentials in a client configuration of its own, removed at the # end: buildx passes them to the builder, the daemon is not involved (and would try HTTPS). Never printed. NOMI=("$IMAGE:sha-${GITHUB_SHA::7}") # :main only if main is still at this commit: a run that arrives late does not move it back. # The job token only in git's environment, as for the sources. The step runs with «bash -e -o # pipefail»: without «|| CIMA=""» an ls-remote error would end the step before the warning, and not even # the :sha- would come out. INTESTAZIONE="Authorization: basic $(printf 'x-access-token:%s' "$GITEA_TOKEN" | base64 -w0)" CIMA=$(GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=http.extraHeader GIT_CONFIG_VALUE_0="$INTESTAZIONE" \ git ls-remote origin refs/heads/main 2> /dev/null | cut -f1) || CIMA="" if [ "$CIMA" = "$GITHUB_SHA" ]; then NOMI+=("$IMAGE:main") elif [ -z "$CIMA" ]; then echo "::warning::Non riesco a leggere la cima di main: si pubblica solo :sha-${GITHUB_SHA::7} e :main resta dov'è." else echo "main è già andato avanti (${CIMA::7}): si pubblica solo :sha-${GITHUB_SHA::7}." fi bash .gitea/scripts/costruisci-immagine.sh pubblica "${NOMI[@]}" - name: Pulizia (sempre) if: always() run: | # The client configuration with the credentials, if an interruption skipped the trap of whoever wrote it. rm -rf "${RUNNER_TEMP:-/tmp}/febe-docker-$ESECUZIONE" if [ -n "${ARCHIVIO:-}" ]; then rm -f "$ARCHIVIO"; fi bash .gitea/scripts/pulizia-docker.sh esecuzione "$ESECUZIONE" # Then, for all the daemon's projects, what nobody uses: unnamed images and dangling build cache unused for # 24 hours. It never fails the job. bash .gitea/scripts/pulizia-docker.sh penzolanti || echo "::warning::La pulizia di ciò che nessuno usa non è riuscita."