From 6093879aa90ef49ae08fa46c8edf9bbe0a17c221 Mon Sep 17 00:00:00 2001 From: Claudecio Martins Date: Tue, 20 Oct 2026 14:33:59 -0300 Subject: [PATCH] ci: add gitea actions ci workflow with maven cache and artifacts --- .gitea/workflows/ci.yml | 95 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..b7935da --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,95 @@ +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: 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 + + 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