-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (40 loc) · 1.47 KB
/
build.yaml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build
on:
push:
branches: [ test ]
# Pull requests targeting main
pull_request:
branches: [ main ]
# opened: when a PR is created
# reopened: when a PR is reopened
# synchronize: when commits are pushed to an open PR
types: [opened, reopened, synchronize]
# # Push to main
# push:
# branches: [ main ]
# Manually triggered
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
env:
REST_API_PATH: src/Apps/ChatService.APIs.REST/ChatService.APIs.REST.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore
run: dotnet restore ${{ env.REST_API_PATH }}
- name: Install Format Tool
run: dotnet tool install -g dotnet-format
# - name: Check Format
# run: dotnet format ${{ env.REST_API_PATH }} --verify-no-changes --verbosity diagnostic
- name: Build (warnings as errors)
run: dotnet build --no-restore -c Release ${{ env.REST_API_PATH }} --warnAsError
#- name: Test
# set when tests are available
# ex) run: dotnet test --no-build --no-restore -c Release tests/ChatService.Core.UnitTests/ChatService.Core.UnitTests.csproj
# ex) run: dotnet test --no-build --no-restore -c Release tests/ChatService.Infrastructure.UnitTests/ChatService.Infrastructure.UnitTests.csproj