-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (47 loc) · 1.23 KB
/
tests.yml
File metadata and controls
53 lines (47 loc) · 1.23 KB
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
name: Tests
run-name: "Build, run tests, package and deploy"
permissions:
contents: read
packages: read
on:
push:
branches:
- main
pull_request:
paths-ignore:
- '**.md'
- klass-forvaltning
- klass-solr
jobs:
check-code-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: '0'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: maven
- name: Check code format
run: mvn --batch-mode fmt:check
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: maven
- name: Build and test
run: mvn --batch-mode --update-snapshots package
- name: SonarQube Cloud Scan
# No need to run SonarCloud analysis if dependabot update or token not defined
if: env.SONAR_TOKEN != '' && (github.actor != 'dependabot[bot]')
run: mvn --batch-mode sonar:sonar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}