-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (33 loc) · 1.07 KB
/
dotnet.yml
File metadata and controls
43 lines (33 loc) · 1.07 KB
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
name: .NET CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore Together.slnx
- name: Build
run: dotnet build Together.slnx --configuration Release --no-restore
- name: Test and collect coverage
run: dotnet test Together.slnx --configuration Release --no-build -p:CollectCoverage=true -p:CoverletOutput=coverage/
- name: Copy coverage files
run: |
mkdir -p "${{ github.workspace }}/coverage"
find . -name "*.opencover.xml" -exec sh -c 'cp "$1" "coverage/coverage-$(basename "$1")"' _ {} \;
- name: List coverage files
run: ls "${{ github.workspace }}/coverage/"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}