-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (47 loc) · 1.6 KB
/
Copy pathci.yml
File metadata and controls
60 lines (47 loc) · 1.6 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
60
name: build-and-test
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
env:
DOTNET_VERSION: '10.0.x'
jobs:
build-and-test:
name: build-and-test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore
run: dotnet restore ManagedCode.FileContext.slnx
- name: Verify formatting
run: dotnet format ManagedCode.FileContext.slnx --verify-no-changes --no-restore
- name: Build
run: dotnet build ManagedCode.FileContext.slnx --configuration Release --no-restore
- name: Test with coverage
run: dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=${{ github.workspace }}/TestResults/coverage
- name: Pack
run: dotnet pack src/ManagedCode.FileContext/ManagedCode.FileContext.csproj --configuration Release --no-build --output artifacts
- name: Upload coverage
uses: actions/upload-artifact@v7
with:
name: coverage
path: TestResults/coverage.opencover.xml
if-no-files-found: error
retention-days: 7
- name: Upload package
uses: actions/upload-artifact@v7
with:
name: package
path: artifacts/*.nupkg
if-no-files-found: error
retention-days: 7