From 99457b40fc73017698bf7f19e4baeed43b302ec3 Mon Sep 17 00:00:00 2001 From: anthorob Date: Wed, 18 Mar 2026 06:23:33 -0400 Subject: [PATCH] fix maven cache in workflow --- .gitea/workflows/ci.yml | 97 +++++------------------------------------ 1 file changed, 11 insertions(+), 86 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 92938df..65047a0 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -10,81 +10,7 @@ on: branches: - "main" -env: - MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=${{ github.workspace }}/.m2/repository -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" - MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version --no-transfer-progress -DinstallAtEnd=true -DdeployAtEnd=true" - # Docker image name; expects REGISTRY_URL like registry.example.com - CI_REGISTRY_IMAGE: "${{ secrets.REGISTRY_URL }}/${{ github.repository }}" - jobs: - compile: - name: Compile - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up JDK - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: '25' - cache: 'maven' - - - name: Cache Maven local repo and wrapper - uses: actions/cache@v5 - with: - path: | - ${{ github.workspace }}/.m2/repository - .mvn - key: m2-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - m2-${{ runner.os }}- - - - name: Compile - run: | - chmod +x ./mvnw - ./mvnw $MAVEN_CLI_OPTS compile - - test: - name: Test - runs-on: ubuntu-latest - needs: compile - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up JDK - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: '25' - cache: 'maven' - - - name: Cache Maven local repo and wrapper - uses: actions/cache@v5 - with: - path: | - ${{ github.workspace }}/.m2/repository - .mvn - key: m2-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - m2-${{ runner.os }}- - - - name: Run tests - run: | - chmod +x ./mvnw - ./mvnw $MAVEN_CLI_OPTS test - - - name: Upload test reports (artifact) - if: always() - uses: actions/upload-artifact@v5 - with: - name: junit-reports - path: | - **/target/*-reports/TEST-*.xml - if-no-files-found: ignore - package: name: Package runs-on: ubuntu-latest @@ -100,20 +26,19 @@ jobs: java-version: '25' cache: 'maven' - - name: Cache Maven local repo and wrapper - uses: actions/cache@v5 - with: - path: | - ${{ github.workspace }}/.m2/repository - .mvn - key: m2-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - m2-${{ runner.os }}- - - - name: Build package (skip tests) + - name: Build package run: | chmod +x ./mvnw - ./mvnw $MAVEN_CLI_OPTS package -DskipTests=true + ./mvnw --batch-mode --update-snapshots verify + + - name: Upload test reports + if: always() + uses: actions/upload-artifact@v5 + with: + name: junit-reports + path: | + **/target/*-reports/TEST-*.xml + if-no-files-found: ignore - name: Upload Maven artifacts uses: actions/upload-artifact@v5