113 lines
3.1 KiB
YAML
113 lines
3.1 KiB
YAML
name: CI Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- 'feature/**'
|
|
- 'fix/**'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build & Verify (Linux x86_64)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repositório
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configurar Java 25 LTS (Temurin)
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '25'
|
|
cache: 'maven'
|
|
|
|
- name: Conceder permissão de execução ao Maven Wrapper
|
|
run: chmod +x ./mvnw
|
|
|
|
- name: Instalar SoftHSM2 para testes de hardware PKCS#11
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y softhsm2
|
|
sudo mkdir -p /var/lib/softhsm/tokens
|
|
sudo chmod 777 /var/lib/softhsm/tokens
|
|
|
|
- name: Executar verificação Maven (Compilação, Testes, JaCoCo, SpotBugs, ArchUnit)
|
|
run: ./mvnw -B clean verify
|
|
|
|
- name: Publicar Relatórios de Cobertura JaCoCo
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: jacoco-reports-linux
|
|
path: |
|
|
modules/*/target/site/jacoco/**
|
|
modules/*/target/jacoco.exec
|
|
retention-days: 14
|
|
|
|
- name: Publicar Relatórios de Análise Estática SpotBugs
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: spotbugs-reports-linux
|
|
path: |
|
|
modules/*/target/spotbugsXml.xml
|
|
modules/*/target/site/spotbugs/**
|
|
retention-days: 14
|
|
|
|
- name: Publicar CycloneDX SBOM (Software Bill of Materials)
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: cyclonedx-sbom
|
|
path: |
|
|
target/bom.json
|
|
target/bom.xml
|
|
retention-days: 30
|
|
|
|
build-windows:
|
|
name: Build & Verify (Windows)
|
|
# Runner Windows: requer act_runner nativo em Windows na instância Gitea.
|
|
# Caso sua instância utilize apenas Docker Linux, configure labels: [windows] no host correspondente.
|
|
runs-on: windows-latest
|
|
continue-on-error: true
|
|
steps:
|
|
- name: Checkout repositório
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configurar Java 25 LTS (Temurin)
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '25'
|
|
cache: 'maven'
|
|
|
|
- name: Executar verificação Maven no Windows
|
|
run: .\mvnw.cmd -B clean verify
|
|
shell: cmd
|
|
|
|
- name: Publicar Relatórios JaCoCo (Windows)
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: jacoco-reports-windows
|
|
path: |
|
|
modules/*/target/site/jacoco/**
|
|
retention-days: 14
|
|
|
|
- name: Publicar Relatórios SpotBugs (Windows)
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: spotbugs-reports-windows
|
|
path: |
|
|
modules/*/target/spotbugsXml.xml
|
|
retention-days: 14
|