-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
224 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"jetbrains.dotcover.globaltool": { | ||
"version": "2023.2.5", | ||
"commands": ["dotnet-dotcover"], | ||
"rollForward": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
watch_file "./nix/env.nix" "./nix/fmt.nix" "./nix/packages.nix" "./nix/shells.nix" "./nix/pre-commit.nix" "./flake.nix" "./parse.nix" | ||
use flake | ||
pls setup | ||
PATH_add "$HOME/.dotnet/tools" | ||
echo "ℹ️ Run 'pls setup' to complete setup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ Chsarpier | |
.env | ||
.idea | ||
.direnv | ||
.pre-commit-config.yaml | ||
.pre-commit-config.yaml | ||
dotCover.Output/ | ||
dotCover.Output.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="coverlet.collector" Version="6.0.2" /> | ||
<PackageReference Include="FluentAssertions" Version="8.0.0-rc.2" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" /> | ||
<PackageReference Include="xunit" Version="2.9.2" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Using Include="Xunit" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\let___svc___\let___svc___.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using FluentAssertions; | ||
using let___namespace___; | ||
|
||
namespace UnitTest; | ||
|
||
public class UnitTest1 | ||
{ | ||
[Fact] | ||
public void Test1() | ||
{ | ||
Class1.HelloWorld().Should().Be("Hello World"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace let___namespace___; | ||
|
||
public class Class1 | ||
{ | ||
public static string HelloWorld() | ||
{ | ||
return "Hello World"; | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,10 @@ with packages; | |
sg | ||
]; | ||
|
||
sonar = [ | ||
jdk | ||
]; | ||
|
||
releaser = [ | ||
sg | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ let | |
|
||
yq = yq-go; | ||
dotnet = dotnet-sdk_9; | ||
jdk = zulu17; | ||
|
||
inherit | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
[ "${PLATFORM}" = '' ] && echo "❌ 'PLATFORM' env var not set" && exit 1 | ||
[ "${SERVICE}" = '' ] && echo "❌ 'SERVICE' env var not set" && exit 1 | ||
[ "${SONAR_TOKEN}" = '' ] && echo "❌ 'SONAR_TOKEN' env var not set" && exit 1 | ||
[ "${SONAR_HOST}" = '' ] && echo "❌ 'SONAR_HOST' env var not set" && exit 1 | ||
[ "${SONAR_ORG}" = '' ] && echo "❌ 'SONAR_ORG' env var not set" && exit 1 | ||
|
||
set -eou pipefail | ||
|
||
# export path | ||
export PATH="$PATH:$HOME/.dotnet/tools" | ||
|
||
echo "⬇️ Installing Dependencies..." | ||
dotnet restore | ||
dotnet tool restore | ||
echo "✅ Done!" | ||
|
||
project="AtomiCloud_${PLATFORM}.${SERVICE}" | ||
|
||
echo "📡 Starting SonarQube..." | ||
dotnet sonarscanner begin /k:"${project}" /o:"${SONAR_ORG}" /d:sonar.token="${SONAR_TOKEN}" /d:sonar.host.url="${SONAR_HOST}" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html | ||
dotnet build --no-incremental | ||
dotnet dotcover test --dcReportType=HTML | ||
dotnet sonarscanner end /d:sonar.token="${SONAR_TOKEN}" | ||
echo "✅ Done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
threshold=${1:-50} | ||
|
||
set -eou pipefail | ||
|
||
# export path | ||
export PATH="$PATH:$HOME/.dotnet/tools" | ||
|
||
echo "⬇️ Installing Dependencies..." | ||
dotnet restore | ||
dotnet tool restore | ||
echo "✅ Done!" | ||
|
||
# build the project | ||
echo "🏗️ Building..." | ||
dotnet build --no-incremental | ||
echo "✅ Done!" | ||
|
||
# run tests | ||
echo "🧪 Running and Coverage..." | ||
dotnet dotcover test --dcReportType=Json --dcFilters=-:testhost | ||
echo "✅ Done!" | ||
|
||
# print coverage | ||
coverage=$(jq -r '.CoveragePercent' ./dotCover.Output.json) | ||
|
||
echo "🧪 Current test coverage: ${coverage}%" | ||
|
||
if (($(echo "$coverage > $threshold" | bc -l))); then | ||
echo "✅ Coverage threshold of ${threshold}% met" | ||
else | ||
echo "❌ Failed:️ current test coverage is below threshold of ${threshold}%." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters