mirror of
https://github.com/krahets/hello-algo.git
synced 2025-02-02 14:18:47 +08:00
feat(csharp): add .net building and testing workflow, solution file (#879)
This commit is contained in:
parent
17252b53a9
commit
fb3ce050c1
38
.github/workflows/dotnet.yml
vendored
Normal file
38
.github/workflows/dotnet.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
# This workflow will build a .NET project
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
|
||||
|
||||
name: .NET
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths: ["codes/csharp/**/*.cs"]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
paths: ["codes/csharp/**/*.cs"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: .NET ${{ matrix.dotnet-version }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
working-directory: codes/csharp/
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
dotnet-version: ["6.0.x"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup .NET ${{ matrix.dotnet-version }}
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet-version }}
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore hello-algo.csproj
|
||||
- name: Build
|
||||
run: dotnet build --no-restore hello-algo.csproj
|
||||
- name: Test with dotnet
|
||||
run: dotnet test hello-algo.csproj
|
25
codes/csharp/csharp.sln
Normal file
25
codes/csharp/csharp.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.002.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "hello-algo", "hello-algo.csproj", "{48B60439-EFDC-4C8F-AE8D-41979958C8AC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{48B60439-EFDC-4C8F-AE8D-41979958C8AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{48B60439-EFDC-4C8F-AE8D-41979958C8AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{48B60439-EFDC-4C8F-AE8D-41979958C8AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{48B60439-EFDC-4C8F-AE8D-41979958C8AC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {1E773F8A-FF66-4974-820B-FCE9032D19AE}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Loading…
Reference in New Issue
Block a user