forked from krahets/hello-algo
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.07 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 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"]
workflow_dispatch:
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: ["8.0.x"]
steps:
- uses: actions/checkout@v4
- 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