-
-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (42 loc) · 1.57 KB
/
pull_request.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Pull Request
on:
pull_request:
paths-ignore:
- 'ReadMe.md'
env:
DOTNET_NOLOGO: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
config:
- debug
- release
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build version suffix
run: echo "VERSION_SUFFIX=alpha.${{ github.event.number }}" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v3
- run: dotnet restore --verbosity minimal
- run: dotnet build --configuration ${{ matrix.config }} /p:ContinuousIntegrationBuild=true
- run: dotnet test --configuration ${{ matrix.config }} --no-build
if: matrix.config == 'release'
- run: dotnet test --configuration ${{ matrix.config }} --verbosity minimal --no-build --collect:"XPlat Code Coverage" --results-directory "./.codecoverage"
if: matrix.config == 'debug'
- run: dotnet pack --configuration ${{ matrix.config }} --no-build --output ./artifacts --version-suffix $VERSION_SUFFIX
if: matrix.config == 'release'
- name: Code coverage
if: matrix.config == 'debug'
uses: codecov/codecov-action@v3
with:
directory: "./.codecoverage"
fail_ci_if_error: true
- name: Publish artifacts
if: matrix.config == 'release'
uses: actions/upload-artifact@v3
with:
name: WorldDomination.SimpleHosting.1.0.0-${{ env.VERSION_SUFFIX }}
path: ./artifacts/