-
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.
Merge branch 'main' into deepsource-config-e452b34e
- Loading branch information
Showing
17 changed files
with
396 additions
and
1 deletion.
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,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"csharpier": { | ||
"version": "0.28.2", | ||
"commands": [ | ||
"dotnet-csharpier" | ||
] | ||
} | ||
} | ||
} |
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 @@ | ||
endOfLine: auto |
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,16 @@ | ||
#!/usr/bin/env bash | ||
LC_ALL=C | ||
|
||
local_branch="$(git rev-parse --abbrev-ref HEAD)" | ||
|
||
valid_branch_regex="^(dependabot|feature|fix|docs|style|refactor|perf|hotfix|test|chore|create)(\/[a-zA-Z0-9._-]+)+$" | ||
|
||
message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name and try again." | ||
|
||
if [[ ! $local_branch =~ $valid_branch_regex ]] | ||
then | ||
echo "$message" | ||
exit 1 | ||
fi | ||
|
||
dotnet tool restore && dotnet csharpier . --check |
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,30 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "nuget" | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 50 | ||
assignees: | ||
- "guibranco" | ||
reviewers: | ||
- "guibranco" | ||
labels: | ||
- "nuget" | ||
- ".NET" | ||
- "packages" | ||
- "dependencies" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 50 | ||
assignees: | ||
- "guibranco" | ||
reviewers: | ||
- "guibranco" | ||
labels: | ||
- "github-actions" | ||
- "dependencies" |
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,36 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
- '*/*' | ||
- '**' | ||
- '!main' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Build solution | ||
run: dotnet build -c Debug | ||
|
||
- name: Run tests | ||
run: dotnet test -c Debug --no-build --no-restore |
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,33 @@ | ||
name: Deep Source | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
DeepSource: | ||
name: Deep Source Coverage report | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Install DeepSource scanner | ||
run: curl https://deepsource.io/cli | sh | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '7.0.x' | ||
|
||
- name: Build and analyze | ||
env: | ||
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} | ||
run: | | ||
dotnet build -c Debug --verbosity minimal | ||
dotnet test -c Debug --verbosity minimal --no-build --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura" | ||
./bin/deepsource report --analyzer test-coverage --key csharp --value-file ./Tests/POCTemplate.Tests/coverage.cobertura.xml |
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,112 @@ | ||
name: Infisical secrets check | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
secrets-scan: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set Infisical package source | ||
shell: bash | ||
run: curl -1sLf 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' | sudo -E bash | ||
|
||
- name: Install tools | ||
shell: bash | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y infisical | ||
pip install csvkit | ||
npm install -g csv-to-markdown-table | ||
- name: Run scan | ||
shell: bash | ||
run: infisical scan --redact -f csv -r secrets-result-raw.csv 2>&1 | tee >(sed -r 's/\x1b\[[0-9;]*m//g' >secrets-result.log) | ||
|
||
- name: Generate report | ||
shell: bash | ||
if: failure() | ||
run: | | ||
if [[ -s secrets-result-raw.csv ]]; then | ||
csvformat -M $'\r' secrets-result-raw.csv | sed -e ':a' -e 'N;$!ba' -e 's/\n/\\n/g' | tr '\r' '\n' | head -n 11 >secrets-result.csv | ||
csv-to-markdown-table --delim , --headers <secrets-result.csv >secrets-result.md | ||
fi | ||
- name: Upload artifacts secrets-result.log | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: report-log | ||
path: secrets-result.log | ||
|
||
- name: Upload artifacts secrets-result.csv | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: report-csv | ||
path: secrets-result.csv | ||
|
||
- name: Upload artifacts secrets-result.md | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: report-md | ||
path: secrets-result.md | ||
|
||
- name: Read secrets-result.log | ||
uses: guibranco/[email protected] | ||
if: always() | ||
id: log | ||
with: | ||
path: secrets-result.log | ||
|
||
- name: Read secrets-result.md | ||
uses: guibranco/[email protected] | ||
if: failure() | ||
id: report | ||
with: | ||
path: secrets-result.md | ||
|
||
- name: Update PR with comment | ||
uses: mshick/add-pr-comment@v2 | ||
if: always() | ||
with: | ||
refresh-message-position: true | ||
message-id: 'secrets-result' | ||
message: | | ||
**Infisical secrets check:** :white_check_mark: No secrets leaked! | ||
**Scan results:** | ||
``` | ||
${{ steps.log.outputs.contents }} | ||
``` | ||
message-failure: | | ||
**Infisical secrets check:** :rotating_light: Secrets leaked! | ||
**Scan results:** | ||
``` | ||
${{ steps.log.outputs.contents }} | ||
``` | ||
<details> | ||
<summary>🔎 Detected secrets in your GIT history</summary> | ||
${{ steps.report.outputs.contents }} | ||
</details> | ||
message-cancelled: | | ||
**Infisical secrets check:** :o: Secrets check cancelled! |
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,24 @@ | ||
name: Linter check | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
linter-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
|
||
- name: Dotnet restore | ||
run: dotnet tool restore | ||
|
||
- name: CSharpier format check | ||
run: | | ||
dotnet csharpier . --check | ||
echo "run 'dotnet build' to fix the formatting of the code automatically" |
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,17 @@ | ||
name: Label based on PR size | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
size-label: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: size-label | ||
uses: "pascalgn/[email protected]" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
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 @@ | ||
POC .NET template |
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,36 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.0.31903.59 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{CCFE3371-AE28-446A-B8D1-8D1027A2D23B}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POCTemplate", "Src\POCTemplate\POCTemplate.csproj", "{5E214FC8-0D9B-4DD7-B952-DA994D094EC4}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{279F38EF-A29A-48E2-9201-BA9D5BACAF5B}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POCTemplate.Tests", "Tests\POCTemplate.Tests\POCTemplate.Tests.csproj", "{43CA48B4-6FC2-425E-82AF-19B643029326}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{5E214FC8-0D9B-4DD7-B952-DA994D094EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{5E214FC8-0D9B-4DD7-B952-DA994D094EC4}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{5E214FC8-0D9B-4DD7-B952-DA994D094EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{5E214FC8-0D9B-4DD7-B952-DA994D094EC4}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{43CA48B4-6FC2-425E-82AF-19B643029326}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{43CA48B4-6FC2-425E-82AF-19B643029326}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{43CA48B4-6FC2-425E-82AF-19B643029326}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{43CA48B4-6FC2-425E-82AF-19B643029326}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{5E214FC8-0D9B-4DD7-B952-DA994D094EC4} = {CCFE3371-AE28-446A-B8D1-8D1027A2D23B} | ||
{43CA48B4-6FC2-425E-82AF-19B643029326} = {279F38EF-A29A-48E2-9201-BA9D5BACAF5B} | ||
EndGlobalSection | ||
EndGlobal |
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,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</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,10 @@ | ||
namespace POCTemplate; | ||
|
||
internal static class Program | ||
{ | ||
public static void Main() | ||
{ | ||
// This is a placeholder for the main entry point of the application. | ||
Console.WriteLine("Hello, World!"); | ||
} | ||
} |
Oops, something went wrong.