Update sonar.token parameter (deprecated sonar.login) #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# JDK | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.17 | |
# Cache | |
- name: Cache maven deps | |
uses: actions/cache@v1 | |
env: | |
cache-name: cache-maven-deps | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Cache sonar | |
uses: actions/cache@v2 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-sonar- | |
# Build Maven | |
- name: Build with Maven | |
run: mvn -B clean verify | |
# Run Sonar | |
- name: Run sonar analysis | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR }} | |
run: mvn sonar:sonar -Dsonar.organization=serendipity-projects -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN | |
# Codecov | |
- name: Code coverage | |
run: bash <(curl -s https://codecov.io/bash) |