2023-10-24 17:13:29 +08:00
|
|
|
# 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"]
|
2023-10-24 23:08:15 +08:00
|
|
|
workflow_dispatch:
|
2023-10-24 17:13:29 +08:00
|
|
|
|
|
|
|
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]
|
2023-11-26 23:18:44 +08:00
|
|
|
dotnet-version: ["8.0.x"]
|
2023-10-24 17:13:29 +08:00
|
|
|
|
|
|
|
steps:
|
2023-10-26 00:09:25 +08:00
|
|
|
- uses: actions/checkout@v4
|
2023-10-24 17:13:29 +08:00
|
|
|
|
|
|
|
- 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
|
2023-10-24 23:08:15 +08:00
|
|
|
run: dotnet test hello-algo.csproj
|