Skip to content

Commit 25e58af

Browse files
committed
Revert "workflow review"
This reverts commit 498b9c4.
1 parent 498b9c4 commit 25e58af

File tree

1 file changed

+49
-13
lines changed

1 file changed

+49
-13
lines changed
Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
# CI with maven build and scan
2-
#
3-
# version 1.1.0
4-
#
5-
# see : https://universe.fugerit.org/src/docs/conventions/workflows/build_maven_package.html
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
63

7-
name: CI maven build and scan
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: CI maven build and sonar cloud scan
810

911
on:
1012
# Trigger analysis when pushing in master or pull requests, and when creating
1113
# a pull request.
1214
push:
1315
branches:
1416
- main
15-
- develop
16-
- branch-preview
1717
- branch-sonarcloud
18+
- branch-test
1819
pull_request:
1920
types:
2021
- opened
@@ -24,10 +25,45 @@ on:
2425
jobs:
2526
build:
2627
name: Build
27-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-22.04
2829
steps:
29-
- uses: fugerit-org/psychic-actions/maven-build-scan@stable
30+
- uses: actions/checkout@main
31+
with:
32+
# Shallow clones should be disabled for a better relevancy of analysis
33+
fetch-depth: 0
34+
- name: Set up JDK 17
35+
uses: actions/setup-java@main
36+
with:
37+
java-version: '17'
38+
distribution: 'corretto'
39+
cache: 'maven'
40+
- name: Cache Maven packages
41+
uses: actions/cache@main
3042
with:
31-
github-token: ${{ secrets.GITHUB_TOKEN }}
32-
sonar-token: ${{ secrets.SONAR_TOKEN }}
33-
disable-maven-dependency-submission: ${{ vars.DISABLE_MAVEN_DEPENDENCY_SUBMISSION }}
43+
path: ~/.m2
44+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
45+
restore-keys: ${{ runner.os }}-m2
46+
- name: Cache SonarCloud packages
47+
uses: actions/cache@main
48+
with:
49+
path: ~/.sonar/cache
50+
key: ${{ runner.os }}-sonar
51+
restore-keys: ${{ runner.os }}-sonar
52+
- name: Maven version
53+
run: mvn -v
54+
env:
55+
# Needed to get some information about the pull request, if any
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
58+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
59+
- name: Build and analyze
60+
run: mvn -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage,full,metadata,sonarfugerit -Dsonar.projectKey=fugerit-org_${{github.event.repository.name}}
61+
env:
62+
# Needed to get some information about the pull request, if any
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
65+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
66+
67+
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
68+
- name: Update dependency graph
69+
uses: advanced-security/maven-dependency-submission-action@main

0 commit comments

Comments
 (0)