Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = always_for_clarity
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity

csharp_style_namespace_declarations = file_scoped

# Expression-bodied members
csharp_style_expression_bodied_local_functions = true
csharp_style_expression_bodied_methods = true
37 changes: 18 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Analyse Code Quality
name: Build and SonarQube
on:
push:
branches:
Expand All @@ -7,51 +7,50 @@ on:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
name: Build and analyze
runs-on: windows-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 1.11
- uses: actions/checkout@v2
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
include-prerelease: false
- name: Cache SonarCloud packages
uses: actions/cache@v1
dotnet-version: 9.0.x
dotnet-quality: preview
- name: Cache SonarQube Cloud packages
uses: actions/cache@v4
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
- name: Cache SonarQube Cloud scanner
id: cache-sonar-scanner
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
- name: Install SonarQube Cloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DOTNET_ROLL_FORWARD: Major
shell: powershell
run: |
$workingDir=pwd
.\.sonar\scanner\dotnet-sonarscanner begin /k:"lsolano_triplex" /o:"lsolano" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.exclusions=tests/**,src/**/GlobalUsings.cs /d:sonar.cs.opencover.reportsPaths="$workingDir/test-results/coverage.net6.0.opencover.xml"
.\.sonar\scanner\dotnet-sonarscanner begin /k:"lsolano_triplex" /o:"lsolano" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.exclusions=tests/**,src/**/GlobalUsings.cs /d:sonar.cs.opencover.reportsPaths="$workingDir/test-results/coverage.net9.0.opencover.xml"
if ("$GITHUB_REF" -ceq "refs/heads/master") {$configuration="Release"} else {$configuration="Debug"}
dotnet clean -c "$configuration"
dotnet build -c "$configuration"
dotnet test --no-restore -c "$configuration" /p:CollectCoverage=true /p:CoverletOutputFormat=json%2copencover /p:MergeWith="$workingDir/test-results/coverage.json" /p:CoverletOutput="$workingDir/test-results/"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
dotnet test --no-restore -c "$configuration" /p:ExcludeByAttribute=GeneratedCode /p:CollectCoverage=true /p:CoverletOutputFormat=json%2copencover /p:MergeWith="$workingDir/test-results/coverage.json" /p:CoverletOutput="$workingDir/test-results/"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
13 changes: 7 additions & 6 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ jobs:
language: [ 'csharp' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.100
dotnet-version: 9.0.x
dotnet-quality: preview

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Build and run Unit Tests with dotnet
run: dotnet test --framework net6.0 --configuration Release
run: dotnet test --framework net9.0 --configuration Release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
15 changes: 8 additions & 7 deletions .github/workflows/nuget_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@ on:
- '1.*'
- '2.*'
- '3.*'
- '4.*'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
include-prerelease: false
dotnet-version: 9.0.x
dotnet-quality: preview

- name: Clean Last Build
run: dotnet clean --framework net6.0 --configuration Release
run: dotnet clean --framework net9.0 --configuration Release

- name: Clean old Packages
run: rm --force src/Validations/bin/Release/Triplex.Validations*.nupkg
Expand All @@ -32,10 +33,10 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build --framework net6.0 --configuration Release
run: dotnet build --framework net9.0 --configuration Release

- name: Test
run: dotnet test --no-build --verbosity normal --framework net6.0 --configuration Release
run: dotnet test --no-build --verbosity normal --framework net9.0 --configuration Release

- name: Package
run: dotnet pack --configuration Release
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/nuget_push_on_demand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
include-prerelease: false
dotnet-version: 9.0.x
dotnet-quality: preview

- name: Clean Last Build
run: dotnet clean --framework net6.0 --configuration Release
run: dotnet clean --framework net9.0 --configuration Release

- name: Clean old Packages
run: rm --force src/Validations/bin/Release/Triplex.Validations*.nupkg
Expand All @@ -27,10 +27,10 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build --framework net6.0 --configuration Release
run: dotnet build --framework net9.0 --configuration Release

- name: Test
run: dotnet test --no-build --verbosity normal --framework net6.0 --configuration Release
run: dotnet test --no-build --verbosity normal --framework net9.0 --configuration Release

- name: Package
run: dotnet pack --configuration Release
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,4 @@ MigrationBackup/
*.orig

coverage.*.json
*.cobertura.xml
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
}
},
"cSpell.words": [
"NETCOREAPP",
"NETSTANDARD",
"Parallelizable"
]
}
Loading