-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
34 lines (34 loc) · 1.68 KB
/
Copy pathaction.yml
File metadata and controls
34 lines (34 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: 'Java CI Sonar'
description: 'Run sonar against Build a Java CI project with maven and Docker'
runs:
using: "composite"
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4.3.2
# build the project in a docker container with a specific maven settings.xml
# it uses env variables from github secrets for the credentials
# to github, dockerhub and sonar.
- name: run sonar with Maven in docker
run: ${{ github.action_path }}/mvn.sh sonar:sonar -D sonar.branch.name=${{ env.GITHUB_REF_SLUG }} -DskipTests=true -Dsonar.language=java -Dsonar.report.export.path=sonar-report.json -Dsonar.host.url=${{ env.SONAR_URL }} -Dsonar.login=${{ env.SONAR_TOKEN }} --activate-profiles sonar
shell: bash
- name: Deploy Maven Artifacts
run: ${{ github.action_path }}/mvn.sh deploy
shell: bash
- name: Notify dedicated teams channel of Success
uses: dragos-cojocari/ms-teams-notification@v1.0.0
if: ${{ success() }}
with:
github-token: ${{ github.token }} # this will use the runner's token.
ms-teams-webhook-uri: ${{ env.MSTEAMS_WEBHOOK }}
notification-summary: Sonar success.
notification-color: 28a745
timezone: Europe/Paris
- name: Notify dedicated teams channel of Failure
uses: dragos-cojocari/ms-teams-notification@v1.0.0
if: ${{ failure() }}
with:
github-token: ${{ github.token }} # this will use the runner's token.
ms-teams-webhook-uri: ${{ env .MSTEAMS_WEBHOOK }}
notification-summary: Sonar failure.
notification-color: dc3545
timezone: Europe/Paris