-
Notifications
You must be signed in to change notification settings - Fork 199
152 lines (141 loc) · 5.76 KB
/
pr.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: PR
on:
pull_request:
branches: [ main ]
defaults:
run:
shell: pwsh
jobs:
setupcheck:
name: Setup Check
runs-on: ubuntu-latest
outputs:
# These outputs must be set otherwise the dependent jobs won't have access to them
app-service-demo: ${{ steps.filter.outputs.app-service-demo }}
calculator: ${{ steps.filter.outputs.calculator }}
calculator-nuget: ${{ steps.filter.outputs.calculator-nuget }}
calculator-coreapp-nuget: ${{ steps.filter.outputs.calculator-coreapp-nuget }}
native-module-sample: ${{ steps.filter.outputs.native-module-sample }}
website: ${{ steps.filter.outputs.website }}
workflows: ${{ steps.filter.outputs.workflows }}
steps:
- uses: actions/checkout@v3
# This task is to calculate which projects/paths had file changes
# Project builds can be skipped in PR if no files changed
# Changes to the "workflow" files should make projects build
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
app-service-demo:
- '.github/workflows/template-buildsample.yml'
- 'samples/AppServiceDemo/**'
calculator:
- '.github/workflows/template-buildsample.yml'
- 'samples/Calculator/**'
calculator-nuget:
- '.github/workflows/template-buildsample.yml'
- 'samples/CalculatorNuGet/**'
calculator-coreapp-nuget:
- '.github/workflows/template-buildsample.yml'
- 'samples/CalculatorCoreAppNuGet/**'
native-module-sample:
- '.github/workflows/template-buildsample.yml'
- 'samples/NativeModuleSample/**'
website:
- '.github/workflows/template-buildwebsite.yml'
- 'docs/**'
- 'website/**'
workflows:
- '.github/workflows/ci.yml'
- '.github/workflows/pr.yml'
call-buildsample-app-service-demo:
name: Build App Service Demo
needs: setupcheck
strategy:
fail-fast: true
matrix:
sampleName: ['AppServiceDemo']
configuration: ['Debug', 'Release']
platform: ['x86']
uses: ./.github/workflows/template-buildsample.yml
with:
sampleName: ${{ matrix.sampleName }}
configuration: ${{ matrix.configuration }}
platform: ${{ matrix.platform }}
extraRunWindowsArgs: --no-deploy
skipBuild: ${{ needs.setupcheck.outputs.workflows != 'true' && needs.setupcheck.outputs.app-service-demo != 'true' }} # Skip if files haven't changed
call-buildsample-calculator:
name: Build Calculator
needs: setupcheck
strategy:
fail-fast: true
matrix:
sampleName: ['Calculator\cppwinrt', 'Calculator\csharp']
configuration: ['Debug', 'Release']
platform: ['x86']
uses: ./.github/workflows/template-buildsample.yml
with:
sampleName: ${{ matrix.sampleName }}
configuration: ${{ matrix.configuration }}
platform: ${{ matrix.platform }}
skipBuild: ${{ needs.setupcheck.outputs.workflows != 'true' && needs.setupcheck.outputs.calculator != 'true' }} # Skip if files haven't changed
call-buildsample-calculator-nuget:
name: Build Calculator NuGet
needs: setupcheck
strategy:
fail-fast: true
matrix:
sampleName: ['CalculatorNuGet']
configuration: ['Debug', 'Release']
platform: ['x86']
uses: ./.github/workflows/template-buildsample.yml
with:
sampleName: ${{ matrix.sampleName }}
configuration: ${{ matrix.configuration }}
platform: ${{ matrix.platform }}
skipBuild: ${{ needs.setupcheck.outputs.workflows != 'true' && needs.setupcheck.outputs.calculator-nuget != 'true' }} # Skip if files haven't changed
call-buildsample-calculator-coreapp-nuget:
name: Build Calculator CoreApp NuGet
needs: setupcheck
strategy:
fail-fast: true
matrix:
sampleName: ['CalculatorCoreAppNuGet']
configuration: ['Debug', 'Release']
platform: ['x86']
uses: ./.github/workflows/template-buildsample.yml
with:
sampleName: ${{ matrix.sampleName }}
configuration: ${{ matrix.configuration }}
platform: ${{ matrix.platform }}
skipBuild: ${{ needs.setupcheck.outputs.workflows != 'true' && needs.setupcheck.outputs.calculator-coreapp-nuget != 'true' }} # Skip if files haven't changed
call-buildsample-native-module-sample:
name: Build Native Module Sample
needs: setupcheck
strategy:
fail-fast: true
matrix:
sampleName: ['NativeModuleSample\cppwinrt', 'NativeModuleSample\csharp']
configuration: ['Debug', 'Release']
platform: ['x86']
uses: ./.github/workflows/template-buildsample.yml
with:
sampleName: ${{ matrix.sampleName }}
configuration: ${{ matrix.configuration }}
platform: ${{ matrix.platform }}
# runCodeGenCheck: true # Enable once we get https://github.com/microsoft/react-native-windows/pull/11187 (Maybe 0.72?)
extraRunWindowsArgs: --no-autolink --no-deploy
skipBuild: ${{ needs.setupcheck.outputs.workflows != 'true' && needs.setupcheck.outputs.native-module-sample != 'true' }} # Skip if files haven't changed
call-buildwebsite:
name: Build Website
needs: setupcheck
uses: ./.github/workflows/template-buildwebsite.yml
with:
skipBuild: ${{ needs.setupcheck.outputs.workflows != 'true' && needs.setupcheck.outputs.website != 'true' }} # Skip if files haven't changed
prcheck:
name: Successful PR Check
runs-on: ubuntu-latest
needs: [setupcheck, call-buildsample-app-service-demo, call-buildsample-calculator, call-buildsample-calculator-nuget, call-buildsample-calculator-coreapp-nuget, call-buildsample-native-module-sample, call-buildwebsite]
steps:
- uses: actions/checkout@v3