Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6040272da |
No files matched your search
+95
-18
@@ -5,41 +5,118 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "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:
|
jobs:
|
||||||
package:
|
compile:
|
||||||
name: Package
|
name: Compile
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
uses: actions/setup-java@v5
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
|
cache: 'maven'
|
||||||
|
|
||||||
- name: Build package
|
- 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: |
|
run: |
|
||||||
chmod +x ./mvnw
|
chmod +x ./mvnw
|
||||||
./mvnw --batch-mode --update-snapshots verify
|
./mvnw $MAVEN_CLI_OPTS compile
|
||||||
|
|
||||||
- name: Upload test reports
|
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()
|
if: always()
|
||||||
uses: actions/upload-artifact@c6a366c94c3e0affe28c06c8df20a878f24da3cf # v3
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: junit-reports
|
name: junit-reports
|
||||||
path: |
|
path: |
|
||||||
**/target/*-reports/TEST-*.xml
|
**/target/*-reports/TEST-*.xml
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
|
|
||||||
|
package:
|
||||||
|
name: Package
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
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: Build package (skip tests)
|
||||||
|
run: |
|
||||||
|
chmod +x ./mvnw
|
||||||
|
./mvnw $MAVEN_CLI_OPTS package -DskipTests=true
|
||||||
|
|
||||||
- name: Upload Maven artifacts
|
- name: Upload Maven artifacts
|
||||||
uses: actions/upload-artifact@c6a366c94c3e0affe28c06c8df20a878f24da3cf # v3
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: maven-artifacts
|
name: maven-artifacts
|
||||||
path: |
|
path: |
|
||||||
@@ -57,23 +134,23 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Download build artifacts
|
- name: Download build artifacts
|
||||||
uses: actions/download-artifact@a9bc5e6ef2cb54c177f32aa5726adaa15e7e2d59 # v3
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: maven-artifacts
|
name: maven-artifacts
|
||||||
path: .
|
path: .
|
||||||
|
|
||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_URL }}
|
registry: ${{ secrets.REGISTRY_URL }}
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and push (main)
|
- name: Build and push (main)
|
||||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
@@ -90,10 +167,10 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Download build artifacts
|
- name: Download build artifacts
|
||||||
uses: actions/download-artifact@a9bc5e6ef2cb54c177f32aa5726adaa15e7e2d59 # v3
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: maven-artifacts
|
name: maven-artifacts
|
||||||
path: .
|
path: .
|
||||||
@@ -107,14 +184,14 @@ jobs:
|
|||||||
echo "version=$ver" >> "$GITHUB_OUTPUT"
|
echo "version=$ver" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_URL }}
|
registry: ${{ secrets.REGISTRY_URL }}
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and push (release + latest)
|
- name: Build and push (release + latest)
|
||||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM eclipse-temurin:25-jre@sha256:ff82c74a630c08b417502c4c18189e62074edbb28eb1f2d31b799ac138c01058
|
FROM eclipse-temurin:25-jre
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends netcat-openbsd curl && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y --no-install-recommends netcat-openbsd curl && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user