Skip to content

Commit 3674865

Browse files
Merge pull request #42 from IowaComputerGurus/feature/sonar-cloud
Returned to SonarCloud
2 parents 9e704ae + 6ff0d06 commit 3674865

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

.github/workflows/ci-build.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ubuntu-latest
12+
runs-on: windows-latest
1313
name: Validate Build
1414
env:
1515
solution-path: './src/NetCore.Utilities.Email.SendGrid.sln'
@@ -33,20 +33,38 @@ jobs:
3333
uses: gittools/actions/gitversion/[email protected]
3434
with:
3535
useConfigFile: true
36-
36+
- name: Set up JDK 17
37+
uses: actions/setup-java@v4
38+
with:
39+
java-version: 17
40+
distribution: 'zulu' # Alternative distribution options are available.
41+
- name: Cache SonarQube Cloud packages
42+
uses: actions/cache@v4
43+
with:
44+
path: .\sonar\cache
45+
key: ${{ runner.os }}-sonar
46+
restore-keys: ${{ runner.os }}-sonar
47+
- name: Cache SonarQube Cloud scanner
48+
id: cache-sonar-scanner
49+
uses: actions/cache@v4
50+
with:
51+
path: .\.sonar\scanner
52+
key: ${{ runner.os }}-sonar-scanner
53+
restore-keys: ${{ runner.os }}-sonar-scanner
54+
- name: Install SonarQube Cloud scanner
55+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
56+
shell: powershell
57+
run: |
58+
New-Item -Path .\.sonar\scanner -ItemType Directory
59+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
3760
- name: Restore Packages
3861
run: dotnet restore "${{ env.solution-path }}"
39-
- name: Build
40-
run: dotnet build "${{ env.solution-path }}" --no-restore --configuration Release -p:version=${{ steps.gitversion.outputs.majorMinorPatch }}
41-
- name: Test
42-
run: dotnet test "${{ env.solution-path }}" --no-build --configuration Release --collect "XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --logger "trx;LogFileName=unittests.trx"
43-
44-
- name: Push Coverage to Codacy
45-
shell: bash
62+
- name: Build and analyze
4663
env:
47-
CODACY_ORGANIZATION_PROVIDER: ${{ secrets.CODACY_ORGANIZATION_PROVIDER }}
48-
CODACY_USERNAME: ${{ secrets.CODACY_USERNAME }}
49-
CODACY_PROJECT_NAME: ${{ secrets.CODACY_PROJECT_NAME }}
50-
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
64+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
65+
shell: powershell
5166
run: |
52-
bash <(curl -Ls https://coverage.codacy.com/get.sh) report $(find . -name '*.opencover.xml' -printf '-r %p ')
67+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"IowaComputerGurus_netcore.utilities.email.sendgrid" /o:"iowacomputergurus-github" /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
68+
dotnet build "${{ env.solution-path }}" --no-restore --configuration Release -p:version=${{ steps.gitversion.outputs.majorMinorPatch }}
69+
dotnet test "${{ env.solution-path }}" --no-build --configuration Release --collect "XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --logger "trx;LogFileName=unittests.trx"
70+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
![Build Status](https://github.com/IowaComputerGurus/netcore.utilities.email/actions/workflows/ci-build.yml/badge.svg)
44

5+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=IowaComputerGurus_netcore.utilities.email.sendgrid&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=IowaComputerGurus_netcore.utilities.email.sendgrid) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=IowaComputerGurus_netcore.utilities.email.sendgrid&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=IowaComputerGurus_netcore.utilities.email.sendgrid) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=IowaComputerGurus_netcore.utilities.email.sendgrid&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=IowaComputerGurus_netcore.utilities.email.sendgrid)
6+
57
![](https://img.shields.io/nuget/v/icg.netcore.utilities.email.sendgrid.svg) ![](https://img.shields.io/nuget/dt/icg.netcore.utilities.email.sendgrid.svg)
68

79
This library provides an easy to use implementation of SendGrid based email delivery. This abstraction with proper interfaces allows email implementation inside of your project with little effort and easy to manage integration, and boasts features such as automatic environment name appending as well as robust email templates.

0 commit comments

Comments
 (0)