-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.99 KB
/
sbt.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
name: Java CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Sbt
run: sbt compile
- name: Test
run: sbt githubTest
- name: Replace all working directory paths with sources path
run: if [[ -n "modules/backend/target/scala-3.3.1/scoverage-report/scoverage.xml" ]]; then sed -i -e s,`pwd`,/github/workspace,g modules/backend/target/scala-3.3.1/scoverage-report/scoverage.xml; fi
shell: bash
- name: Analyze with SonarCube
uses: sonarsource/sonarqube-scan-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
with:
args: >
-Dsonar.projectKey=kamenitxan_Jakon_AYX5P6qaok6eoBlpoZHT
-Dsonar.sources=modules/backend/src
-Dsonar.verbose=false
-Dsonar.exclusions=modules/backend/src/main/resources/**,modules/backend/src/test/**
-Dsonar.scala.coverage.reportPaths=modules/backend/target/scala-3.3.1/scoverage-report/scoverage.xml