-
Notifications
You must be signed in to change notification settings - Fork 67
84 lines (73 loc) · 2.17 KB
/
dotnet-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
81
82
83
84
name: .NET CI
on:
pull_request:
branches: ["*"]
paths:
- "src/**"
- "examples/**"
- "tests/**"
- Directory.Build.props
- Directory.Build.targets
- Directory.Packages.props
- ".github/workflows/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
fail-fast: false
runs-on: "${{ matrix.os }}"
env:
DOTNET_CONFIGURATION: Release
DAPR_VERSION: "1.14.1"
steps:
- uses: actions/checkout@v4
- name: Setup Runtimes, Caching, and Tools
uses: ./.github/actions/setup-runtimes-caching
with:
name: "Full"
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration ${{ env.DOTNET_CONFIGURATION }}
run-tests:
uses: ./.github/workflows/tests.yaml
package:
uses: ./.github/workflows/package.yml
with:
version_suffix: "alpha.${{ github.run_number }}"
needs: run-tests
if: ${{ github.actor != 'dependabot[bot]' }}
publish-azure-artifacts:
if: github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository
needs: package
runs-on: windows-latest
environment:
name: azure-artifacts
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: nuget-packages
- name: Add AzDO NuGet feed
run: >
dotnet nuget add source
https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-PullRequests/nuget/v3/index.json
--name PullRequests
--username dummy
--password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
- name: Push signed packages to AzDO
run: >
dotnet nuget push
"${{ github.workspace }}/**/*.nupkg"
--api-key dummy
--source PullRequests
--skip-duplicate
publish-coverage:
if: github.actor != 'dependabot[bot]'
needs: run-tests
uses: ./.github/workflows/code-coverage.yml
secrets: inherit