-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (69 loc) · 2.13 KB
/
CI.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on:
push:
branches:
- '**'
paths-ignore:
- '.devcontainer/**'
- '.vscode/settings.json'
- '.editorconfig'
- 'CONTRIBUTING.md'
- 'NuGet.md'
- 'README.md'
- 'build.ps1'
- 'build.sh'
- 'testgen.sh'
tags-ignore:
- '*.*.*'
pull_request:
paths-ignore:
- '.devcontainer/**'
- '.vscode/settings.json'
- '.editorconfig'
- 'CONTRIBUTING.md'
- 'NuGet.md'
- 'README.md'
- 'build.ps1'
- 'build.sh'
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Disable telemetry message
DOTNET_NOLOGO: true
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Do not extract XML documentation files from nuget packages
NUGET_XMLDOC_MODE: skip
PROJECT_CONFIGURATION: Release
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name : dotnet restore
run: dotnet restore
- name: dotnet build
run: dotnet build --configuration ${{ env.PROJECT_CONFIGURATION }} --no-restore
- name: dotnet test
run: dotnet test --configuration ${{ env.PROJECT_CONFIGURATION }} -f net8.0 /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --no-restore --verbosity minimal
- name: dotnet test (.NET Framework)
if: matrix.os == 'windows-latest'
run: dotnet test test/PhoneNumbers.Tests/PhoneNumbers.Tests.csproj --configuration ${{ env.PROJECT_CONFIGURATION }} -f net462 --no-restore --verbosity minimal
- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: dotnet pack
run: dotnet pack --no-build --configuration ${{ env.PROJECT_CONFIGURATION }}