-
Notifications
You must be signed in to change notification settings - Fork 11
67 lines (67 loc) · 2.88 KB
/
maven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: CI Coherence Hibernate
run-name: ${{ github.event.head_commit.message }} [${{ github.event_name }}][${{ github.ref_name }}]
on:
push:
branches:
- main
- '[1-9]+.[0-9]+.x'
workflow_dispatch:
jobs:
build:
if: github.repository_owner == 'coherence-community'
strategy:
matrix:
coherence-version: [ 'LATEST' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Set up JDK 17
uses: actions/setup-java@v4.7.0
with:
distribution: 'adopt'
java-version: '17'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Build - Hibernate 6.x with Maven + Sonar
if: "github.event_name != 'pull_request'"
run: |
git config --global user.email "github-action@users.noreply.github.com"
git config --global user.name "GitHub Action"
./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=coherence-community_coherence-hibernate -Dsonar.branch.name=${{ env.GITHUB_REF_NAME }} -B -Phibernate6 -Powasp -Pcoverage
env:
MAVEN_GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
SONAR_TOKEN: "${{secrets.SONAR_TOKEN}}"
NVD_API_KEY: "${{secrets.NVD_API_KEY}}"
- name: Build - Hibernate 6.x
if: "github.event_name == 'pull_request'"
run: mvn clean install -B -Powasp -Phibernate6
- name: Build - Hibernate 5.6.x
run: mvn clean install -B -Powasp -Phibernate53
- name: Build with Coherence ${{ matrix.coherence-version }}
if: "matrix.coherence-version == '14_1_1'"
run: |
git config --global user.email "github-action@users.noreply.github.com"
git config --global user.name "GitHub Action"
mvn clean install -B --settings .mvn/settings.xml -Pcoherence14_1_1
- name: Build + deploy with Maven (Website + Snapshots) - ${{ matrix.coherence-version }}
if: "matrix.coherence-version == 'LATEST'"
run: |
git config --global user.email "github-action@users.noreply.github.com"
git config --global user.name "GitHub Action"
mvn clean deploy -B -Powasp --settings .mvn/settings.xml
env:
MAVEN_GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
MAVEN_SONATYPE_USERNAME: "${{secrets.MAVEN_SONATYPE_USERNAME}}"
MAVEN_SONATYPE_TOKEN: "${{secrets.MAVEN_SONATYPE_TOKEN}}"
NVD_API_KEY: "${{secrets.NVD_API_KEY}}"
- name: Clean Maven cache
run: |
find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr