ci: add gitea actions ci workflow with maven cache and artifacts
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user