Skip to content

Refactoring updates #171

Refactoring updates

Refactoring updates #171

Workflow file for this run

name: quality
on:
push:
branches:
- "*"
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
path: main
- uses: actions/checkout@v4
with:
repository: ISAITB/itb-commons
path: commons
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}
- name: Generate Maven settings
uses: whelk-io/maven-settings-xml-action@v22
with:
repositories: >
[
{
"id": "itbRepoRead",
"name": "itbRepoRead",
"url": "${{ secrets.ITB_MVN_REPO_URL }}",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true"
}
}
]
servers: >
[
{
"id": "itbRepoRead",
"username": "${{ secrets.ITB_MVN_REPO_USER }}",
"password": "${{ secrets.ITB_MVN_REPO_PASS }}"
}
]
profiles: >
[
{
"id": "itbRepoRead",
"properties": {
"itbRepoReadUrl": "${{ secrets.ITB_MVN_REPO_URL }}"
}
}
]
active_profiles: >
[
"itbRepoRead", "github"
]
- name: Install commons
run: mvn -B install -DskipTests=true
working-directory: commons
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=ISAITB_csv-validator
working-directory: main