-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (67 loc) · 2.5 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
name: build
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
inputs:
branch_cdc:
description: 'Cdc branch'
required: true
default: 'master'
env:
MAVEN_OPTS: -Xmx1g
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v22
with:
repositories: '[{ "id": "repository.spring.milestone", "url": "https://repo.spring.io/milestone" }]'
plugin_repositories: '[{ "id": "repository.spring.milestone", "url": "https://repo.spring.io/milestone" }]'
- name: Checkout exemple cdc
uses: actions/checkout@v4
with:
path: exemple-cdc
repository: doudouchat/exemple-cdc
ref: ${{ github.event.inputs.branch_cdc }}
- name: Build exemple cdc
run: mvn -f ${{ github.workspace }}/exemple-cdc --batch-mode clean install -Dmaven.test.skip=true
- name: Build with Maven
run: mvn --batch-mode clean verify -Pservice,it -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Analyse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.organization=doudouchat -Dsonar.projectKey=doudouchat_exemple-service -Dsonar.host.url=https://sonarcloud.io -Dsonar.java.enablePreview=true
- name: display logs service
if: ${{ always() }}
run: cat exemple-service-api-launcher/target/.logs/service/archive/*.log
- name: display logs cdc
if: ${{ always() }}
run: cat exemple-service-api-launcher/target/.logs/cassandra/archive/*.log