-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (45 loc) · 1.64 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
name: Build CDI Test
on:
push:
pull_request:
schedule:
- cron: '0 19 * * 6'
jobs:
build:
name: Maven Build JDK ${{ matrix.java }} Jakarta EE ${{ matrix.jakarta-ee }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ '11', '17', '21' ]
jakarta-ee: [ '9', '10' ]
include:
- java: 17
extratestargs: >
jacoco:report
sonar:sonar
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.organization=guhilling-github
-Dsonar.projectKey=de.hilling.junit.cdi:cdi-test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
- name: Maven Build JDK ${{ matrix.java }} Jakarta EE ${{ matrix.jakarta-ee }}
run: mvn -B package -Pjakarta-ee-${{ matrix.jakarta-ee }} --file pom.xml -DskipTests ${{ matrix.extraargs }}
- name: Maven Test with Sonar JDK ${{ matrix.java }} Jakarta EE ${{ matrix.jakarta-ee }}
if: ${{ env.SONAR_TOKEN != '' }}
run: mvn -B test -PPjakarta-ee-${{ matrix.jakarta-ee }} --file pom.xml ${{ matrix.extraargs }} ${{ matrix.extratestargs}}
- name: Maven Test JDK ${{ matrix.java }} Jakarta EE ${{ matrix.jakarta-ee }} (Pull Request)
if: ${{ env.SONAR_TOKEN == '' }}
run: mvn -B test -PPjakarta-ee-${{ matrix.jakarta-ee }} --file pom.xml ${{ matrix.extraargs }}