-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (30 loc) · 1.05 KB
/
dotnet-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
name: dotnet-build
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
issue_comment:
types: [created]
env:
BUILD_CONFIG: Debug
jobs:
build-dotnet:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@actions /build')) }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Get PR branch
uses: xt0rted/pull-request-comment-branch@v3
id: comment-branch
if: ${{ github.event_name == 'issue_comment' }}
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'issue_comment' && steps.comment-branch.outputs.head_ref || ''}}
- uses: guitarrapc/actions/.github/actions/setup-dotnet@main
- name: Build
run: dotnet build -c ${{ env.BUILD_CONFIG }}
- name: Test
run: dotnet test --no-build -c ${{ env.BUILD_CONFIG }} --logger GitHubActions --logger "console;verbosity=normal"