-
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
0 parents
commit 95a13d9
Showing
17 changed files
with
1,161 additions
and
0 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,12 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: nuget | ||
directory: "/tests" | ||
schedule: | ||
interval: weekly | ||
time: "21:00" | ||
- package-ecosystem: nuget | ||
directory: "/src" | ||
schedule: | ||
interval: weekly | ||
time: "21:00" |
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,31 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '27 7 * * 2' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: 'ubuntu-latest' | ||
permissions: | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: csharp | ||
build-mode: autobuild | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:csharp" |
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,74 @@ | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.version.outputs.next_tag }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '8.x' | ||
- id: version | ||
name: Calculate Version | ||
uses: craig-day/compute-tag@v18 | ||
with: | ||
github_token: ${{ github.token }} | ||
version_type: patch | ||
- name: Install dependencies (Solution) | ||
run: dotnet restore src/NHealthCheck.csproj | ||
- name: Build | ||
run: dotnet build --configuration Release --no-restore /p:Version=${{ steps.version.outputs.next_tag }} src/NHealthCheck.csproj | ||
- name: Install dependencies (Test) | ||
run: dotnet restore tests/NHealthCheck.Tests.csproj | ||
- name: Test | ||
run: dotnet test tests/NHealthCheck.Tests.csproj --collect:"XPlat Code Coverage" | ||
- name: Coverage | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
file: tests/TestResults/**/coverage.cobertura.xml | ||
- name: Upload Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: NuGetPackage | ||
path: ./src/bin/Release/NHealthCheck.${{ steps.version.outputs.next_tag }}.nupkg | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
if: ${{ contains(github.ref, 'main') }} | ||
needs: [ build ] | ||
|
||
steps: | ||
- name: Download Build Artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: NuGetPackage | ||
- name: Push to NuGet | ||
run: dotnet nuget push ./NHealthCheck.${{ needs.build.outputs.version }}.nupkg -k $NuGetApiKey -s https://api.nuget.org/v3/index.json | ||
env: | ||
NuGetApiKey: ${{ secrets.NuGetApiKey }} | ||
- name: Release | ||
id: release | ||
uses: comnoco/create-release-action@v2 | ||
with: | ||
tag_name: ${{ needs.build.outputs.version }} | ||
release_name: ${{ needs.build.outputs.version }} | ||
body: 'Automatic release of ${{ needs.build.outputs.version }}' | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Upload Release Asset | ||
uses: csexton/release-asset-action@v3 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
release-url: ${{ steps.release.outputs.upload_url }} | ||
file: ./NHealthCheck.${{ needs.build.outputs.version }}.nupkg |
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,34 @@ | ||
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,dotnetcore | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,dotnetcore | ||
|
||
### DotnetCore ### | ||
# .NET Core build folders | ||
bin/ | ||
obj/ | ||
|
||
# Common node modules locations | ||
/node_modules | ||
/wwwroot/node_modules | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
.ionide | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,dotnetcore | ||
|
||
TestResults |
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,7 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-dotnettools.csdevkit", | ||
"github.vscode-github-actions", | ||
"ryanluker.vscode-coverage-gutters" | ||
] | ||
} |
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,19 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "test with coverage", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"test", | ||
"--collect:\"XPlat Code Coverage\"" | ||
], | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.