Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4ec52a4fe | ||
|
|
3d28471b2c | ||
|
|
ddf60dcd2b |
No files matched your search
@@ -11,11 +11,15 @@ on:
|
||||
jobs:
|
||||
auto-release:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 15
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory || '.' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
@@ -37,6 +41,7 @@ jobs:
|
||||
echo "current_tag=$CURRENT_TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create release
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
SERVER_URL: ${{ gitea.server_url }}
|
||||
|
||||
@@ -6,9 +6,13 @@ on:
|
||||
jobs:
|
||||
branch-cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 10
|
||||
if: gitea.event.pull_request.merged == true
|
||||
steps:
|
||||
- name: Delete merged branch
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
SERVER_URL: ${{ gitea.server_url }}
|
||||
|
||||
@@ -41,11 +41,16 @@ on:
|
||||
jobs:
|
||||
android-build:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Node.js
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ inputs.node-version || '24.16.0' }}
|
||||
@@ -54,15 +59,18 @@ jobs:
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Setup Java
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: ${{ inputs.java-version || '17' }}
|
||||
|
||||
- name: Setup Android SDK
|
||||
timeout-minutes: 20
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-android@v4
|
||||
|
||||
- name: Cache npm
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
@@ -71,6 +79,7 @@ jobs:
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Cache Gradle
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
@@ -92,15 +101,19 @@ jobs:
|
||||
echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: npm ci
|
||||
|
||||
- name: Build web app
|
||||
timeout-minutes: 15
|
||||
run: npm run build
|
||||
|
||||
- name: Add Android platform
|
||||
timeout-minutes: 10
|
||||
run: npx cap add android || true
|
||||
|
||||
- name: Sync Capacitor
|
||||
timeout-minutes: 10
|
||||
run: npx cap sync android
|
||||
|
||||
# La piattaforma Android puo essere generata da 'cap add' (default Capacitor:
|
||||
@@ -201,6 +214,7 @@ jobs:
|
||||
|
||||
- name: Build Android (APK)
|
||||
if: inputs.output-format == 'apk'
|
||||
timeout-minutes: 30
|
||||
working-directory: android
|
||||
env:
|
||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||
@@ -224,6 +238,7 @@ jobs:
|
||||
|
||||
- name: Build Android (AAB)
|
||||
if: inputs.output-format == 'aab'
|
||||
timeout-minutes: 30
|
||||
working-directory: android
|
||||
env:
|
||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||
@@ -240,6 +255,7 @@ jobs:
|
||||
|
||||
- name: Upload APK artifact
|
||||
if: inputs.output-format == 'apk'
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ steps.app-info.outputs.name }}-${{ steps.app-info.outputs.version }}-${{ inputs.build-type }}-apk
|
||||
@@ -248,6 +264,7 @@ jobs:
|
||||
|
||||
- name: Upload AAB artifact
|
||||
if: inputs.output-format == 'aab'
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ steps.app-info.outputs.name }}-${{ steps.app-info.outputs.version }}-release-aab
|
||||
@@ -256,6 +273,7 @@ jobs:
|
||||
|
||||
- name: Upload Gradle build reports
|
||||
if: always()
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/upload-artifact@v3
|
||||
with:
|
||||
name: gradle-build-reports
|
||||
|
||||
@@ -15,14 +15,19 @@ on:
|
||||
jobs:
|
||||
dependency-audit:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 20
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory || '.' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Node.js
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ inputs.node-version || '24.16.0' }}
|
||||
@@ -31,6 +36,7 @@ jobs:
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Cache npm
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
@@ -44,9 +50,11 @@ jobs:
|
||||
echo "//gitea.pzetatouch.it/api/packages/PZeta_Touch/npm/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: npm ci
|
||||
|
||||
- name: Security audit
|
||||
timeout-minutes: 10
|
||||
id: audit
|
||||
run: |
|
||||
npm audit --audit-level=high --json > audit.json 2>/dev/null || true
|
||||
@@ -55,6 +63,7 @@ jobs:
|
||||
|
||||
- name: Open issue if vulnerabilities found
|
||||
if: steps.audit.outputs.vulnerabilities != '0'
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
SERVER_URL: ${{ gitea.server_url }}
|
||||
|
||||
@@ -15,14 +15,19 @@ on:
|
||||
jobs:
|
||||
dependency-outdated:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 20
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory || '.' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Node.js
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ inputs.node-version || '24.16.0' }}
|
||||
@@ -31,6 +36,7 @@ jobs:
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Cache npm
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
@@ -44,9 +50,11 @@ jobs:
|
||||
echo "//gitea.pzetatouch.it/api/packages/PZeta_Touch/npm/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: npm ci
|
||||
|
||||
- name: Check outdated packages
|
||||
timeout-minutes: 10
|
||||
id: outdated
|
||||
run: |
|
||||
npm outdated --json > outdated.json 2>/dev/null || true
|
||||
@@ -55,6 +63,7 @@ jobs:
|
||||
|
||||
- name: Open issue if packages outdated
|
||||
if: steps.outdated.outputs.count != '0'
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
SERVER_URL: ${{ gitea.server_url }}
|
||||
|
||||
@@ -16,11 +16,16 @@ on:
|
||||
jobs:
|
||||
docker-release:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Node.js
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ inputs.node-version || '24.16.0' }}
|
||||
@@ -30,9 +35,11 @@ jobs:
|
||||
|
||||
- name: Upgrade npm
|
||||
if: inputs.npm-version != ''
|
||||
timeout-minutes: 10
|
||||
run: npm install -g npm@${{ inputs.npm-version }}
|
||||
|
||||
- name: Cache npm
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
@@ -46,6 +53,7 @@ jobs:
|
||||
echo "//gitea.pzetatouch.it/api/packages/PZeta_Touch/npm/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: npm ci
|
||||
|
||||
- name: Type check
|
||||
@@ -58,12 +66,15 @@ jobs:
|
||||
run: npm run format:check
|
||||
|
||||
- name: Build
|
||||
timeout-minutes: 15
|
||||
run: npm run build
|
||||
|
||||
- name: Test
|
||||
timeout-minutes: 20
|
||||
run: npm run test
|
||||
|
||||
- name: Login to container registry
|
||||
timeout-minutes: 5
|
||||
uses: https://gitea.pzetatouch.it/actions/login-action@v4
|
||||
with:
|
||||
registry: gitea.pzetatouch.it
|
||||
@@ -82,6 +93,7 @@ jobs:
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push Docker image
|
||||
timeout-minutes: 30
|
||||
uses: https://gitea.pzetatouch.it/actions/build-push-action@v7
|
||||
with:
|
||||
push: true
|
||||
|
||||
@@ -32,14 +32,19 @@ on:
|
||||
jobs:
|
||||
link-check:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 15
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory || '.' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Node.js
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ inputs.node-version || '24.16.0' }}
|
||||
@@ -48,6 +53,7 @@ jobs:
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Collegamenti interni
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
SCRIPT: ${{ inputs.script || 'scripts/verifica-link-docs.mjs' }}
|
||||
run: |
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
# segreti nei log a ogni tag. Qui la scelta sicura non e' piu' derogabile, e per
|
||||
# ispezionare la configurazione si esegue il generatore in locale.
|
||||
#
|
||||
# L'action resta senza prefisso di host, come nei chiamanti: si risolve con
|
||||
# l'URL di default del runner, che e' dove il generatore e' pubblicato.
|
||||
# Il generatore era l'ultima action esterna del portale: referenziata senza
|
||||
# prefisso di host si risolveva sul DEFAULT_ACTIONS_URL del runner. Ora e'
|
||||
# mirrorata in actions/k8s-yaml-generator e il riferimento e' esplicito.
|
||||
|
||||
name: Generate K8s YAML
|
||||
|
||||
@@ -21,7 +22,7 @@ on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
generator-version:
|
||||
description: 'Tag di punga78/k8s-yaml-generator. Si aggiorna qui, una volta per tutti.'
|
||||
description: 'Tag del mirror actions/k8s-yaml-generator. Si aggiorna qui, una volta per tutti.'
|
||||
type: string
|
||||
default: 'v0.13'
|
||||
instance:
|
||||
@@ -91,12 +92,17 @@ on:
|
||||
jobs:
|
||||
generate-yaml:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Generate K8s YAML
|
||||
uses: punga78/k8s-yaml-generator@${{ inputs.generator-version || 'v0.13' }}
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/k8s-yaml-generator@${{ inputs.generator-version || 'v0.13' }}
|
||||
with:
|
||||
instance: ${{ inputs.instance }}
|
||||
envName: ${{ inputs.env-name || '.env.default' }}
|
||||
@@ -121,10 +127,12 @@ jobs:
|
||||
pvcSize: ${{ inputs.pvc-size || '10Mi' }}
|
||||
|
||||
- name: Upload Artifact
|
||||
# Resta alla v5 dei chiamanti: la v7 esiste, ma passare dalla v5 alla v7
|
||||
# qui significherebbe far viaggiare un aggiornamento non verificato
|
||||
# insieme al consolidamento. Si alza a parte, con una run di prova.
|
||||
uses: https://gitea.pzetatouch.it/actions/upload-artifact@v5
|
||||
timeout-minutes: 10
|
||||
# v3 e non v5: la v5 che avevano i chiamanti non e' mai stata provata su
|
||||
# questo runner, e questo workflow parte solo su un tag a*, cioe' al
|
||||
# rilascio. Le v4+ usano l'API artifact nuova; su Gitea 1.27.3 c'e', ma
|
||||
# va verificata con un tag usa e getta prima di metterla qui (#28).
|
||||
uses: https://gitea.pzetatouch.it/actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifact-name || 'K8s_Yaml' }}
|
||||
path: ${{ inputs.directory-path || 'k8s' }}/
|
||||
@@ -14,14 +14,19 @@ on:
|
||||
jobs:
|
||||
npm-publish:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 30
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory || '.' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Node.js
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ inputs.node-version || '24.16.0' }}
|
||||
@@ -30,6 +35,7 @@ jobs:
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Cache npm
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
@@ -43,6 +49,7 @@ jobs:
|
||||
echo "//gitea.pzetatouch.it/api/packages/PZeta_Touch/npm/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
@@ -55,10 +62,13 @@ jobs:
|
||||
run: npm run format:check
|
||||
|
||||
- name: Build
|
||||
timeout-minutes: 15
|
||||
run: npm run build
|
||||
|
||||
- name: Test
|
||||
timeout-minutes: 20
|
||||
run: npm run test
|
||||
|
||||
- name: Publish
|
||||
timeout-minutes: 10
|
||||
run: npm publish
|
||||
@@ -11,11 +11,15 @@ on:
|
||||
jobs:
|
||||
python-auto-release:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 15
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
@@ -48,6 +52,7 @@ jobs:
|
||||
echo "name=$APP_NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create release
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
SERVER_URL: ${{ gitea.server_url }}
|
||||
|
||||
@@ -26,14 +26,19 @@ on:
|
||||
jobs:
|
||||
python-dependency-audit:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 20
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Python
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-python@v7
|
||||
with:
|
||||
python-version: ${{ inputs.python-version || '3.11' }}
|
||||
@@ -67,6 +72,7 @@ jobs:
|
||||
echo "Registry PyPI di Gitea aggiunto come indice extra (credenziali da netrc)."
|
||||
|
||||
- name: Cache pip
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
@@ -76,6 +82,7 @@ jobs:
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install dependencies (isolated venv)
|
||||
timeout-minutes: 15
|
||||
run: |
|
||||
# venv pulita: audita SOLO le dipendenze dichiarate dal repo,
|
||||
# non l'ambiente globale del runner (che su runner ML/GPU è contaminato)
|
||||
@@ -90,6 +97,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Security audit (pip-audit)
|
||||
timeout-minutes: 10
|
||||
id: audit
|
||||
run: |
|
||||
.audit-venv/bin/pip-audit --format=json --output=audit.json 2>/dev/null || true
|
||||
@@ -107,6 +115,7 @@ jobs:
|
||||
|
||||
- name: Open or update issue if vulnerabilities found
|
||||
if: steps.audit.outputs.vulnerabilities != '0'
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
SERVER_URL: ${{ gitea.server_url }}
|
||||
|
||||
@@ -26,14 +26,19 @@ on:
|
||||
jobs:
|
||||
python-dependency-outdated:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 20
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Python
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-python@v7
|
||||
with:
|
||||
python-version: ${{ inputs.python-version || '3.11' }}
|
||||
@@ -67,6 +72,7 @@ jobs:
|
||||
echo "Registry PyPI di Gitea aggiunto come indice extra (credenziali da netrc)."
|
||||
|
||||
- name: Cache pip
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
@@ -76,6 +82,7 @@ jobs:
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install dependencies (isolated venv)
|
||||
timeout-minutes: 15
|
||||
run: |
|
||||
# venv pulita: elenca come obsolete SOLO le dipendenze dichiarate dal repo,
|
||||
# non i pacchetti globali del runner (torch/cuda/nvidia su runner ML/GPU)
|
||||
@@ -90,6 +97,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Check outdated packages
|
||||
timeout-minutes: 10
|
||||
id: outdated
|
||||
run: |
|
||||
.audit-venv/bin/pip list --outdated --format=json > outdated.json 2>/dev/null || echo '[]' > outdated.json
|
||||
@@ -98,6 +106,7 @@ jobs:
|
||||
|
||||
- name: Open or update issue if packages outdated
|
||||
if: steps.outdated.outputs.count != '0'
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
SERVER_URL: ${{ gitea.server_url }}
|
||||
|
||||
@@ -34,14 +34,19 @@ on:
|
||||
jobs:
|
||||
python-docker-release:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 45
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Python
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-python@v7
|
||||
with:
|
||||
python-version: ${{ inputs.python-version || '3.11' }}
|
||||
@@ -86,6 +91,7 @@ jobs:
|
||||
echo "Registry PyPI di Gitea aggiunto come indice extra (credenziali da netrc)."
|
||||
|
||||
- name: Cache pip
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
@@ -95,6 +101,7 @@ jobs:
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -n "${{ inputs.install-extras }}" ]; then
|
||||
@@ -117,9 +124,11 @@ jobs:
|
||||
run: mypy .
|
||||
|
||||
- name: Test (pytest)
|
||||
timeout-minutes: 20
|
||||
run: pytest --tb=short -q
|
||||
|
||||
- name: Login to container registry
|
||||
timeout-minutes: 5
|
||||
uses: https://gitea.pzetatouch.it/actions/login-action@v4
|
||||
with:
|
||||
registry: gitea.pzetatouch.it
|
||||
@@ -155,6 +164,7 @@ jobs:
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push Docker image
|
||||
timeout-minutes: 30
|
||||
uses: https://gitea.pzetatouch.it/actions/build-push-action@v7
|
||||
with:
|
||||
push: true
|
||||
|
||||
@@ -43,6 +43,9 @@ on:
|
||||
jobs:
|
||||
python-package-release:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 30
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
@@ -52,9 +55,11 @@ jobs:
|
||||
PACKAGES_API_URL: https://gitea.pzetatouch.it/api/v1/packages/PZeta_Touch/pypi
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Python
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-python@v7
|
||||
with:
|
||||
python-version: ${{ inputs.python-version || '3.11' }}
|
||||
@@ -102,6 +107,7 @@ jobs:
|
||||
# messaggio esplicito che con il 409 di twine a fine job. Qualsiasi risposta diversa
|
||||
# da 200/404 (token scaduto, registry giù) blocca: non si pubblica alla cieca.
|
||||
- name: Verifica che la versione non sia già pubblicata
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
NAME: ${{ steps.meta.outputs.name }}
|
||||
VERSION: ${{ steps.meta.outputs.version }}
|
||||
@@ -125,6 +131,7 @@ jobs:
|
||||
esac
|
||||
|
||||
- name: Cache pip
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
@@ -137,6 +144,7 @@ jobs:
|
||||
# il controllo dell'installazione tramite requirements-dev.txt (es. per forzare le
|
||||
# wheel CPU di torch con --extra-index-url, non esprimibile in pyproject.toml).
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -n "${{ inputs.install-extras }}" ]; then
|
||||
@@ -160,11 +168,13 @@ jobs:
|
||||
run: mypy .
|
||||
|
||||
- name: Test (pytest)
|
||||
timeout-minutes: 20
|
||||
run: pytest --tb=short -q
|
||||
|
||||
# Build isolata (PEP 517): il backend dichiarato in [build-system] viene installato in
|
||||
# un ambiente temporaneo, quindi l'artefatto non dipende da cosa c'è nel venv del job.
|
||||
- name: Build (wheel + sdist)
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
rm -rf dist
|
||||
python -m build
|
||||
@@ -174,6 +184,7 @@ jobs:
|
||||
run: twine check --strict dist/*
|
||||
|
||||
- name: Publish sul registry PyPI di Gitea
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
TWINE_REPOSITORY_URL: ${{ env.PYPI_UPLOAD_URL }}
|
||||
TWINE_USERNAME: ${{ secrets.G_USER }}
|
||||
|
||||
@@ -27,14 +27,19 @@ on:
|
||||
jobs:
|
||||
python-quality-gates:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 30
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Python
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-python@v7
|
||||
with:
|
||||
python-version: ${{ inputs.python-version || '3.11' }}
|
||||
@@ -79,6 +84,7 @@ jobs:
|
||||
echo "Registry PyPI di Gitea aggiunto come indice extra (credenziali da netrc)."
|
||||
|
||||
- name: Cache pip
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
@@ -88,6 +94,7 @@ jobs:
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -n "${{ inputs.install-extras }}" ]; then
|
||||
@@ -110,6 +117,7 @@ jobs:
|
||||
run: mypy .
|
||||
|
||||
- name: Test (pytest)
|
||||
timeout-minutes: 20
|
||||
run: pytest --tb=short -q
|
||||
|
||||
- name: Rimozione credenziali registry PyPI
|
||||
|
||||
@@ -34,14 +34,19 @@ on:
|
||||
jobs:
|
||||
quality-gates:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 30
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory || '.' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
|
||||
- name: Setup Node.js
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ inputs.node-version || '24.16.0' }}
|
||||
@@ -51,9 +56,11 @@ jobs:
|
||||
|
||||
- name: Upgrade npm
|
||||
if: inputs.npm-version != ''
|
||||
timeout-minutes: 10
|
||||
run: npm install -g npm@${{ inputs.npm-version }}
|
||||
|
||||
- name: Cache npm
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
@@ -510,12 +517,15 @@ jobs:
|
||||
exit 1
|
||||
|
||||
- name: Check outdated packages
|
||||
timeout-minutes: 10
|
||||
run: npm outdated || true
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: npm ci
|
||||
|
||||
- name: Security audit
|
||||
timeout-minutes: 10
|
||||
run: npm audit --audit-level=high || true
|
||||
|
||||
- name: Lint
|
||||
@@ -528,7 +538,9 @@ jobs:
|
||||
run: npm run format:check
|
||||
|
||||
- name: Build
|
||||
timeout-minutes: 15
|
||||
run: npm run build
|
||||
|
||||
- name: Test
|
||||
timeout-minutes: 20
|
||||
run: npm run test
|
||||
@@ -0,0 +1,133 @@
|
||||
name: VSIX Release
|
||||
|
||||
# Compila il pacchetto .vsix di un'estensione VS Code e lo allega alla release Gitea del tag.
|
||||
# Va eseguito dopo auto-release.yml (needs), che crea la release.
|
||||
#
|
||||
# Prerequisiti nel repository chiamante:
|
||||
# - package.json con script: lint:check, typecheck, format:check, build, test, package
|
||||
# - lo script package produce <name>-<version>.vsix nella working-directory
|
||||
# - il tag deve essere 'v' + version
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
working-directory:
|
||||
description: 'Cartella che contiene package.json, relativa alla root del repo. Default: la root.'
|
||||
type: string
|
||||
default: '.'
|
||||
node-version:
|
||||
type: string
|
||||
default: '24.16.0'
|
||||
|
||||
jobs:
|
||||
vsix-release:
|
||||
runs-on: ubuntu-latest
|
||||
# Il chiamante non puo' dichiararlo: su un job che usa un workflow
|
||||
# riusabile timeout-minutes non e' una chiave ammessa (devops/shared-actions#23).
|
||||
timeout-minutes: 30
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory || '.' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/checkout@v7
|
||||
with:
|
||||
token: ${{ gitea.token }}
|
||||
|
||||
# Prima di installare: un tag disallineato produrrebbe un .vsix con un'altra versione.
|
||||
- name: Check tag version
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
VERSION=$(jq -r '.version' package.json)
|
||||
if [ "$TAG" != "v$VERSION" ]; then
|
||||
echo "::error::Il tag $TAG non corrisponde alla versione $VERSION di package.json (atteso v$VERSION)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Setup Node.js
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ inputs.node-version || '24.16.0' }}
|
||||
# La cache npm resta allo step actions/cache: dalla v5 setup-node la accende
|
||||
# da solo se package.json ha packageManager, e la duplicherebbe.
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Cache npm
|
||||
timeout-minutes: 10
|
||||
uses: https://gitea.pzetatouch.it/actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Configure npm private registry
|
||||
run: |
|
||||
echo "@pzeta:registry=https://gitea.pzetatouch.it/api/packages/PZeta_Touch/npm/" >> ~/.npmrc
|
||||
echo "//gitea.pzetatouch.it/api/packages/PZeta_Touch/npm/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
|
||||
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 15
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint:check
|
||||
|
||||
- name: Type check
|
||||
run: npm run typecheck
|
||||
|
||||
- name: Format check
|
||||
run: npm run format:check
|
||||
|
||||
- name: Build
|
||||
timeout-minutes: 15
|
||||
run: npm run build
|
||||
|
||||
- name: Test
|
||||
timeout-minutes: 20
|
||||
run: npm run test
|
||||
|
||||
- name: Package VSIX
|
||||
timeout-minutes: 10
|
||||
run: npm run package
|
||||
|
||||
- name: Attach VSIX to release
|
||||
timeout-minutes: 10
|
||||
shell: bash
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
SERVER_URL: ${{ gitea.server_url }}
|
||||
REPOSITORY: ${{ gitea.repository }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
VSIX="$(jq -r '.name' package.json)-$(jq -r '.version' package.json).vsix"
|
||||
API="$SERVER_URL/api/v1/repos/$REPOSITORY"
|
||||
|
||||
if [ ! -f "$VSIX" ]; then
|
||||
echo "::error::Lo script package non ha prodotto $VSIX."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! RELEASE=$(curl -sS --fail-with-body --max-time 60 \
|
||||
-H "Authorization: token $GITEA_TOKEN" "$API/releases/tags/$TAG"); then
|
||||
echo "::error::Release del tag $TAG non trovata: $RELEASE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Rieseguendo il job, o se l'allegato e' stato caricato a mano, non si sovrascrive.
|
||||
if echo "$RELEASE" | jq -e --arg name "$VSIX" 'any(.assets[]?; .name == $name)' > /dev/null; then
|
||||
echo "::notice::$VSIX e' gia' allegato alla release $TAG: nessun caricamento."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ID=$(echo "$RELEASE" | jq -r '.id')
|
||||
curl -sS --fail-with-body --max-time 300 -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-F "attachment=@$VSIX" \
|
||||
"$API/releases/$ID/assets?name=$VSIX" > /dev/null
|
||||
echo "$VSIX allegato alla release $TAG."
|
||||
@@ -0,0 +1,23 @@
|
||||
# Copia in: .gitea/workflows/ci.yml
|
||||
# Usato da: estensioni VS Code
|
||||
#
|
||||
# Prerequisiti:
|
||||
# - package.json con script: lint:check, typecheck, format:check, build, test
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'docs/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
quality-gates:
|
||||
uses: https://gitea.pzetatouch.it/devops/shared-actions/.gitea/workflows/quality-gates.yml@v1
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,36 @@
|
||||
# Copia in: .gitea/workflows/maintenance.yml
|
||||
# Trigger:
|
||||
# - PR merged → cleanup branch sorgente
|
||||
# - Ogni lunedì 08:00 → security audit vulnerabilità (settimanale)
|
||||
# - Ogni 1° del mese → controllo pacchetti obsoleti (mensile)
|
||||
# - Manuale → workflow_dispatch (esegue tutti i job di manutenzione)
|
||||
|
||||
name: Maintenance
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
schedule:
|
||||
- cron: '0 2 * * 3' # ogni mercoledì alle 02:00 → security audit
|
||||
- cron: '0 2 1 * *' # ogni 1° del mese alle 02:00 → outdated check
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
branch-cleanup:
|
||||
if: gitea.event_name == 'pull_request' && gitea.event.pull_request.merged == true
|
||||
uses: https://gitea.pzetatouch.it/devops/shared-actions/.gitea/workflows/branch-cleanup.yml@v1
|
||||
secrets: inherit
|
||||
|
||||
dependency-audit:
|
||||
if: >
|
||||
gitea.event_name == 'workflow_dispatch' ||
|
||||
(gitea.event_name == 'schedule' && gitea.event.schedule == '0 2 * * 3')
|
||||
uses: https://gitea.pzetatouch.it/devops/shared-actions/.gitea/workflows/dependency-check.yml@v1
|
||||
secrets: inherit
|
||||
|
||||
dependency-outdated:
|
||||
if: >
|
||||
gitea.event_name == 'workflow_dispatch' ||
|
||||
(gitea.event_name == 'schedule' && gitea.event.schedule == '0 2 1 * *')
|
||||
uses: https://gitea.pzetatouch.it/devops/shared-actions/.gitea/workflows/dependency-outdated.yml@v1
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copia in: .gitea/workflows/release.yml
|
||||
# Trigger: git tag v* → crea la release Gitea e le allega il pacchetto .vsix
|
||||
#
|
||||
# NOTA: vsix-release attende auto-release via needs, perché carica nella release già creata.
|
||||
# Workaround Gitea bug #31900: token esplicito nel checkout dei workflow condivisi.
|
||||
#
|
||||
# Prerequisiti:
|
||||
# - package.json con script: lint:check, typecheck, format:check, build, test, package
|
||||
# - il tag deve essere 'v' + version di package.json
|
||||
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
auto-release:
|
||||
uses: https://gitea.pzetatouch.it/devops/shared-actions/.gitea/workflows/auto-release.yml@v1
|
||||
secrets: inherit
|
||||
|
||||
vsix-release:
|
||||
needs: [auto-release]
|
||||
uses: https://gitea.pzetatouch.it/devops/shared-actions/.gitea/workflows/vsix-release.yml@v1
|
||||
secrets: inherit
|
||||
Reference in new issue
Block a user