Skip to content

Commit fb3ce05

Browse files
authored
feat(csharp): add .net building and testing workflow, solution file (krahets#879)
1 parent 17252b5 commit fb3ce05

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/dotnet.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
paths: ["codes/csharp/**/*.cs"]
10+
pull_request:
11+
branches: [ "main" ]
12+
paths: ["codes/csharp/**/*.cs"]
13+
14+
jobs:
15+
build:
16+
name: .NET ${{ matrix.dotnet-version }} on ${{ matrix.os }}
17+
runs-on: ${{ matrix.os }}
18+
defaults:
19+
run:
20+
working-directory: codes/csharp/
21+
strategy:
22+
matrix:
23+
os: [ubuntu-latest, macos-latest, windows-latest]
24+
dotnet-version: ["6.0.x"]
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
- name: Setup .NET ${{ matrix.dotnet-version }}
30+
uses: actions/setup-dotnet@v3
31+
with:
32+
dotnet-version: ${{ matrix.dotnet-version }}
33+
- name: Restore dependencies
34+
run: dotnet restore hello-algo.csproj
35+
- name: Build
36+
run: dotnet build --no-restore hello-algo.csproj
37+
- name: Test with dotnet
38+
run: dotnet test hello-algo.csproj

codes/csharp/csharp.sln

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.002.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "hello-algo", "hello-algo.csproj", "{48B60439-EFDC-4C8F-AE8D-41979958C8AC}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{48B60439-EFDC-4C8F-AE8D-41979958C8AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{48B60439-EFDC-4C8F-AE8D-41979958C8AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{48B60439-EFDC-4C8F-AE8D-41979958C8AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{48B60439-EFDC-4C8F-AE8D-41979958C8AC}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {1E773F8A-FF66-4974-820B-FCE9032D19AE}
24+
EndGlobalSection
25+
EndGlobal

0 commit comments

Comments
 (0)