mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
Using the `setup-maven-action` GitHub action we can both simplify the build configuration and configure the version of Maven to use. See https://github.com/s4u/setup-maven-action
36 lines
1.3 KiB
YAML
36 lines
1.3 KiB
YAML
# Analyzes the code base using SonarCloud. See
|
|
# https://sonarcloud.io/project/overview?id=PicnicSupermarket_error-prone-support.
|
|
name: SonarCloud analysis
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [ master ]
|
|
schedule:
|
|
- cron: '0 4 * * 1'
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
analyze:
|
|
# Analysis of code in forked repositories is skipped, as such workflow runs
|
|
# do not have access to the requisite secrets.
|
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Check out code and set up JDK and Maven
|
|
uses: s4u/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 # v1.11.0
|
|
with:
|
|
checkout-fetch-depth: 0
|
|
java-version: 17.0.8
|
|
java-distribution: temurin
|
|
maven-version: 3.9.6
|
|
- name: Create missing `test` directory
|
|
# XXX: Drop this step in favour of actually having a test.
|
|
run: mkdir refaster-compiler/src/test
|
|
- name: Perform SonarCloud analysis
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
run: mvn -T1C jacoco:prepare-agent verify jacoco:report sonar:sonar -Dverification.skip -Dsonar.projectKey=PicnicSupermarket_error-prone-support
|