-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (42 loc) · 1.48 KB
/
ci.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
# 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'
# Controls when the action will run.
on:
workflow_call:
workflow_dispatch:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- main
pull_request:
jobs:
continuous-testing:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Runs a single command using the runners shell
- name: Set up JDK 1.17
uses: actions/setup-java@v4
with:
distribution: "liberica"
java-version: "17"
cache: "maven"
- name: Compile
run: mvn clean compile
- name: Unit Test
run: mvn test
- name: Integration API Test
run: mvn verify -Pintegration-test
- uses: dorny/test-reporter@v1
with:
name: Test Results
path: "target/**/TEST*.xml"
reporter: java-junit
- name: Analyze with SonarCloud
run: mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=sonarqubegeekshubs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}