-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (35 loc) · 1.21 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
# 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
# Uses a Maven cache to reduce traffic to Maven Central and speed up the build, see: https://github.com/marketplace/actions/maven-cache
name: CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '45 3 15 * *'
jobs:
build-and-sonar:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Restore Maven cache
uses: skjolber/maven-cache-github-action@v1
with:
step: restore
- name: Build and analyze with Sonar
run: mvn -B -U verify sonar:sonar -Dsonar.projectKey=ch.ge.cti.ct:jours-feries -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=etat-de-geneve-github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Save Maven cache
uses: skjolber/maven-cache-github-action@v1
with:
step: save