-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (66 loc) · 2.52 KB
/
Copy pathpull-request.yaml
File metadata and controls
72 lines (66 loc) · 2.52 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
61
62
63
64
65
66
67
68
69
70
71
72
name: pull-request
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
env:
DOTNET_VERSION: 10.0.x
CONFIGURATION: Staging
jobs:
metadata:
runs-on: ubuntu-latest
outputs:
has_solution: ${{ steps.repository.outputs.has_solution }}
solution_path: ${{ steps.repository.outputs.solution_path }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- id: repository
name: Discover .NET repository
shell: pwsh
run: ./packaging/Get-RepositoryMetadata.ps1 -Configuration '${{ env.CONFIGURATION }}' -GitHubOutputPath $env:GITHUB_OUTPUT
validate:
needs: metadata
if: needs.metadata.outputs.has_solution == 'true'
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: Windows
verify_packages: false
- os: ubuntu-latest
name: Linux
verify_packages: true
- os: macos-latest
name: macOS
verify_packages: false
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore
run: dotnet restore '${{ needs.metadata.outputs.solution_path }}'
- name: Build
run: dotnet build '${{ needs.metadata.outputs.solution_path }}' -c ${{ env.CONFIGURATION }} --no-restore -p:ContinuousIntegrationBuild=true
- name: Test
run: dotnet test '${{ needs.metadata.outputs.solution_path }}' -c ${{ env.CONFIGURATION }} --no-build --no-restore --logger trx
- name: Pack Staging artifacts
if: matrix.verify_packages
run: dotnet pack '${{ needs.metadata.outputs.solution_path }}' -c ${{ env.CONFIGURATION }} --no-build --no-restore -o artifacts -p:ContinuousIntegrationBuild=true
- name: Verify exact Staging package artifacts
if: matrix.verify_packages
shell: pwsh
run: ./packaging/VerifyPackageArtifact.ps1 -ArtifactDirectory artifacts -Configuration '${{ env.CONFIGURATION }}' -AllowNoPackages
- name: Smoke linux-x64 release archive construction
if: matrix.verify_packages
shell: pwsh
run: ./packaging/BuildReleaseArchive.ps1 -Configuration '${{ env.CONFIGURATION }}' -RuntimeIdentifier 'linux-x64' -Version 'pr'