-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
10 changed files
with
207 additions
and
12 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
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 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "nuget" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
90 changes: 90 additions & 0 deletions
90
templates/Console/ConsoleApp/.github/workflows/build-and-deploy.yml
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,90 @@ | ||
name: Build and deploy | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up .NET Core | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '7.x' | ||
|
||
- name: dotnet restore | ||
run: dotnet restore | ||
|
||
- name: dotnet build | ||
run: dotnet build --configuration Release --no-restore | ||
|
||
- name: dotnet test | ||
run: dotnet test --configuration Release --no-build --collect:"XPlat Code Coverage" --results-directory ./code-coverage | ||
|
||
- name: ReportGenerator | ||
uses: danielpalme/[email protected] | ||
with: | ||
reports: code-coverage/**/coverage.cobertura.xml | ||
targetdir: coveragereport | ||
reporttypes: Html;MarkdownSummaryGithub | ||
title: 'Code Coverage' | ||
|
||
- name: Write PR Number | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
echo ${{ github.event.number }} > ./coveragereport/PullRequestNumber | ||
- name: Upload Code Coverage Report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: CodeCoverage | ||
path: coveragereport/ | ||
if-no-files-found: error | ||
|
||
- name: dotnet pack | ||
run: dotnet pack --configuration Release --no-build -o ./NuGet | ||
|
||
- name: Upload NuGet artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: NuGet | ||
path: ./NuGet | ||
|
||
automerge: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
steps: | ||
- uses: fastify/[email protected] | ||
with: | ||
use-github-auto-merge: true | ||
|
||
deploy-nuget: | ||
if: ${{ github.event_name != 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
steps: | ||
- name: Download artifact from build job | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: NuGet | ||
|
||
- name: Push NuGet | ||
run: dotnet nuget push ${{ github.workspace }}/*nupkg --source https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate |
35 changes: 35 additions & 0 deletions
35
templates/Console/ConsoleApp/.github/workflows/pr-code-coverage-comment.yml
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 @@ | ||
name: Post Code Coverage on Pull Request | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Build and deploy] | ||
types: | ||
- completed | ||
|
||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
jobs: | ||
post-code-coverage: | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
- name: Download artifacts | ||
run: gh run download ${{ github.event.workflow_run.id }} -n CodeCoverage --repo ${{ github.repository }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: 'Get PR Number' | ||
id: get-pr-number | ||
run: | | ||
$pr_number = (cat PullRequestNumber) | ||
"pr_number=$pr_number" >> $env:GITHUB_OUTPUT | ||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
recreate: true | ||
number: ${{ steps.get-pr-number.outputs.pr_number }} | ||
path: SummaryGithub.md |
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
Empty file.