Skip to content

Commit 19c0637

Browse files
committed
✨Migrate to GitHub Actions and setup Dependatbot
1 parent 9f1ebfa commit 19c0637

28 files changed

+325
-760
lines changed

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
2+
[*.{csproj,props}]
3+
indent_size = 2
24
[*.cs]
35

46
#Core editorconfig formatting - indentation

.github/dependabot.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions" # See documentation for possible values
4+
directory: "/" # Location of package manifests
5+
schedule:
6+
interval: "weekly"
7+
assignees:
8+
- "mgrosperrin"
9+
commit-message:
10+
prefix: "[GH Actions Update] "
11+
include: "scope"
12+
groups:
13+
gh-actions:
14+
patterns:
15+
- "*"
16+
17+
- package-ecosystem: "nuget" # See documentation for possible values
18+
directory: "/" # Location of package manifests
19+
schedule:
20+
interval: "weekly"
21+
assignees:
22+
- "mgrosperrin"
23+
commit-message:
24+
prefix: "[.NET packages update] "
25+
include: "scope"
26+
groups:
27+
dotnet:
28+
patterns:
29+
- "*"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
feedUrl:
5+
description: 'NuGet feed URL'
6+
required: true
7+
type: string
8+
forRelease:
9+
description: 'Run for release?'
10+
required: true
11+
type: boolean
12+
secrets:
13+
feedAPIKey:
14+
description: 'NuGet feed API key'
15+
required: true
16+
17+
jobs:
18+
build:
19+
strategy:
20+
fail-fast: false
21+
runs-on: windows-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Git Semantic Version
29+
id: version
30+
uses: PaulHatch/semantic-version@v5.4.0
31+
with:
32+
tag_prefix: ''
33+
version_format: "${major}.${minor}.${patch}${{ !inputs.forRelease && '-preview${increment}' || '' }}"
34+
search_commit_body: true
35+
36+
- name: Setup dotnet ${{ env.DOTNET_VERSION }}
37+
uses: actions/setup-dotnet@v4
38+
with:
39+
dotnet-version: ${{ env.DOTNET_VERSION }}
40+
41+
- name: Build and Pack
42+
run: dotnet build -c Release -p:Version=${{ steps.version.outputs.version}}
43+
44+
- name: Run tests
45+
run: dotnet test -c Release --no-build
46+
47+
- name: Upload dotnet test results
48+
uses: dorny/test-reporter@v1.8.0
49+
if: ${{ !cancelled() }}
50+
with:
51+
name: .NET Tests
52+
path: 'TestResults/**/*.trx'
53+
reporter: dotnet-trx
54+
fail-on-error: true
55+
56+
- name: Push to NuGet package feed
57+
env:
58+
NUGET_URL: ${{ inputs.feedUrl }}
59+
NUGET_API_KEY: ${{ secrets.feedAPIKey }}
60+
run: dotnet nuget push '**/*.nupkg' --source "$($env:NUGET_URL)" --api-key "$($env:NUGET_API_KEY)"
61+
if: github.event_name == 'push'

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
DOTNET_VERSION: '8.0.x'
17+
18+
permissions:
19+
checks: write
20+
contents: read
21+
22+
jobs:
23+
call_buildAndPublish:
24+
uses: ./.github/workflows/buildAndPublish.yml
25+
with:
26+
feedUrl: https://www.myget.org/F/mgrosperrin/api/v3/index.json
27+
forRelease: false
28+
secrets:
29+
feedAPIKey: ${{ secrets.MYGET_CI_API_KEY }}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '38 16 * * 5'
10+
11+
env:
12+
DOTNET_VERSION: '8.0.x'
13+
14+
jobs:
15+
analyze:
16+
name: Analyze
17+
runs-on: 'ubuntu-latest'
18+
timeout-minutes: 360
19+
permissions:
20+
# required for all workflows
21+
security-events: write
22+
23+
contents: read
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
language: [ 'csharp' ]
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
# Initializes the CodeQL tools for scanning.
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@v3
37+
with:
38+
languages: ${{ matrix.language }}
39+
40+
- name: Setup dotnet ${{ env.DOTNET_VERSION }}
41+
uses: actions/setup-dotnet@v4
42+
with:
43+
dotnet-version: ${{ env.DOTNET_VERSION }}
44+
45+
- name: Build projects
46+
run: dotnet build -c Release
47+
48+
- name: Perform CodeQL Analysis
49+
uses: github/codeql-action/analyze@v3
50+
with:
51+
category: "/language:${{matrix.language}}"

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
DOTNET_VERSION: '8.0.x'
14+
15+
permissions:
16+
checks: write
17+
contents: read
18+
19+
jobs:
20+
call_buildAndPublish:
21+
uses: ./.github/workflows/buildAndPublish.yml
22+
with:
23+
feedUrl: https://api.nuget.org/v3/index.json
24+
forRelease: true
25+
secrets:
26+
feedAPIKey: ${{ secrets.NUGET_API_KEY }}
27+
28+
generate_docs:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- name: Build documenation site
34+
uses: nunit/docfx-action@v3.1.0
35+
with:
36+
args: docs/docfx.json
37+
- name: Upload documentation archive
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
path: artifacts/_site
41+
publish_docs:
42+
needs: [call_buildAndPublish, generate_docs]
43+
permissions:
44+
pages: write
45+
id-token: write
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.url }}
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Publish documentation
52+
uses: actions/deploy-pages@v4
53+
id: deployment

CustomDictionary.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<DebugType>portable</DebugType>
1212
<IsPackable>true</IsPackable>
1313
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
14-
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)$(Product).ruleset</CodeAnalysisRuleSet>
1514

1615
<Authors>Matthias GROSPERRIN</Authors>
1716
<Company></Company>
@@ -23,6 +22,8 @@
2322
<NeutralLanguage>en-US</NeutralLanguage>
2423
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
2524
<PackageLicenseExpression>MIT</PackageLicenseExpression>
25+
<VSTestLogger>trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
26+
<VSTestResultsDirectory>$(MSBuildThisFileDirectory)/TestResults/$(TargetFramework)</VSTestResultsDirectory>
2627
</PropertyGroup>
2728

2829
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

Directory.Packages.props

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
5+
<DotNetMainVersion>8.0.0</DotNetMainVersion>
6+
<DotNetLastVersion>8.0.0</DotNetLastVersion>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageVersion Include="coverlet.collector" Version="6.0.1">
11+
<PrivateAssets>all</PrivateAssets>
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
</PackageVersion>
14+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
15+
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
16+
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
17+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
18+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
19+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
20+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
21+
<PackageVersion Include="Moq" Version="4.20.70" />
22+
<PackageVersion Include="Seq.Extensions.Logging" Version="8.0.0" />
23+
<PackageVersion Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" />
24+
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
25+
<PackageVersion Include="xunit" Version="2.7.0" />
26+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7">
27+
<PrivateAssets>all</PrivateAssets>
28+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
29+
</PackageVersion>
30+
</ItemGroup>
31+
</Project>

GitVersionConfig.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)