-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (51 loc) · 1.68 KB
/
test.yml
File metadata and controls
59 lines (51 loc) · 1.68 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build and test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install workloads
run: dotnet workload install android
- name: Check format
run: |
dotnet tool restore
dotnet csharpier check .
- name: Restore dependencies
run: dotnet restore /p:EnableWindowsTargeting=true
- name: Build
run: dotnet build --no-restore --configuration Release /p:EnableWindowsTargeting=true
- name: Test
run: |
dotnet test ${{ env.SOLUTION_NAME }} --no-build --configuration Release \
--collect:"XPlat Code Coverage;Format=cobertura" \
--results-directory ./coverage-results
- name: Post Coverage Report
uses: rosslight/pr-code-coverage-visualizer@v2.2.0
with:
files: |
coverage-results/**/coverage.cobertura.xml
exclude-files: |
*.g.cs