-
Notifications
You must be signed in to change notification settings - Fork 0
26 lines (23 loc) · 963 Bytes
/
test.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
name: Tests
on:
push:
pull_request:
jobs:
test-backend:
runs-on: ubuntu-22.04
steps:
#checkout your github code using actions/[email protected]
- uses: actions/[email protected]
#do the same with another action (actions/setup-java@v3) that enable to setup jdk 17
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin" # See 'Supported distributions' for available options
java-version: "21"
#finally build your app with the latest command
- name: Build and test with Maven
working-directory: backend-api
run: mvn clean verify
- name: Send to sonarcloud for static analysis
working-directory: backend-api
run: mvn -B verify sonar:sonar -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} -Dsonar.organization=${{ vars.SONAR_ORGANIZATION }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }}