Skip to content

Build, run tests, package and deploy #1081

Build, run tests, package and deploy

Build, run tests, package and deploy #1081

Workflow file for this run

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 }}