Skip to content

Commit 6c05ea2

Browse files
committed
add CI
1 parent f195517 commit 6c05ea2

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- Phase08
7+
8+
pull_request:
9+
types: [opened, synchronize, reopened]
10+
branches:
11+
- master
12+
13+
jobs:
14+
build:
15+
if: |
16+
(github.event_name == 'push') ||
17+
(github.event_name == 'pull_request' && github.head_ref == 'Phase08')
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Setup .NET
25+
uses: actions/setup-dotnet@v2
26+
with:
27+
dotnet-version: 8.0.x
28+
cache: true
29+
30+
- name: Install dependencies
31+
run: dotnet restore
32+
working-directory: ./
33+
34+
- name: Build
35+
run: dotnet build --configuration Release --no-restore
36+
working-directory: ./
37+
38+
- name: Test
39+
run: dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage"
40+
working-directory: ./
41+
42+
- name: Publish code coverage reports to codecove.io
43+
uses: codecov/codecov-action@v1
44+
with:
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
files: ./**/coverage.cobertura.xml
47+
fail_ci_if_error: true

0 commit comments

Comments
 (0)