forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (168 loc) · 4.7 KB
/
windows-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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Windows-CI
on:
workflow_dispatch:
push:
branches:
- master
- release/**
paths:
- "**"
- "!.vsts-ci/misc-analysis.yml"
- "!.github/ISSUE_TEMPLATE/**"
- "!.dependabot/config.yml"
- "!test/perf/**"
- "!.pipelines/**"
pull_request:
branches:
- master
- release/**
# Path filters for PRs need to go into the changes job
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ contains(github.ref, 'merge')}}
permissions:
contents: read
run-name: "${{ github.ref_name }} - ${{ github.run_number }}"
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'"
NugetSecurityAnalysisWarningLevel: none
POWERSHELL_TELEMETRY_OPTOUT: 1
__SuppressAnsiEscapeSequences: 1
nugetMultiFeedWarnLevel: none
jobs:
changes:
name: Change Detection
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
source: ${{ steps.filter.outputs.source }}
steps:
- name: checkout
uses: actions/[email protected]
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: json
filters: .github/action-filters.yml
- name: Capture outputs
run: |
"source: ${{ steps.filter.outputs.source }}"
"github: ${{ steps.filter.outputs.github }}"
"tools: ${{ steps.filter.outputs.tools }}"
"props: ${{ steps.filter.outputs.props }}"
"tests: ${{ steps.filter.outputs.tests }}"
"mainSource: ${{ steps.filter.outputs.mainSource }}"
"buildModule: ${{ steps.filter.outputs.buildModule }}"
shell: pwsh
ci_build:
name: Build PowerShell
needs: changes
if: ${{ needs.changes.outputs.source == 'true' }}
runs-on: windows-latest
steps:
- name: checkout
uses: actions/[email protected]
with:
fetch-depth: 1000
- name: Build
uses: "./.github/actions/build/ci"
windows_test_unelevated_ci:
name: Windows Unelevated CI
needs:
- ci_build
- changes
if: ${{ needs.changes.outputs.source == 'true' }}
runs-on: windows-latest
steps:
- name: checkout
uses: actions/[email protected]
with:
fetch-depth: 1000
- name: Windows Unelevated CI
uses: "./.github/actions/test/windows"
with:
purpose: UnelevatedPesterTests
tagSet: CI
windows_test_elevated_ci:
name: Windows Elevated CI
needs:
- ci_build
- changes
if: ${{ needs.changes.outputs.source == 'true' }}
runs-on: windows-latest
steps:
- name: checkout
uses: actions/[email protected]
with:
fetch-depth: 1000
- name: Windows Elevated CI
uses: "./.github/actions/test/windows"
with:
purpose: ElevatedPesterTests
tagSet: CI
windows_test_unelevated_others:
name: Windows Unelevated Others
needs:
- ci_build
- changes
if: ${{ needs.changes.outputs.source == 'true' }}
runs-on: windows-latest
steps:
- name: checkout
uses: actions/[email protected]
with:
fetch-depth: 1000
- name: Windows Unelevated Others
uses: "./.github/actions/test/windows"
with:
purpose: UnelevatedPesterTests
tagSet: Others
windows_test_elevated_others:
name: Windows Elevated Others
needs:
- ci_build
- changes
if: ${{ needs.changes.outputs.source == 'true' }}
runs-on: windows-latest
steps:
- name: checkout
uses: actions/[email protected]
with:
fetch-depth: 1000
- name: Windows Elevated Others
uses: "./.github/actions/test/windows"
with:
purpose: ElevatedPesterTests
tagSet: Others
verify_xunit:
name: Verify xUnit test results
needs:
- ci_build
- changes
if: ${{ needs.changes.outputs.source == 'true' }}
runs-on: windows-latest
steps:
- name: checkout
uses: actions/[email protected]
with:
fetch-depth: 1000
- name: Verify xUnit test results
uses: "./.github/actions/test/verify_xunit"
ready_to_merge:
name: windows ready to merge
needs:
- verify_xunit
- windows_test_elevated_ci
- windows_test_elevated_others
- windows_test_unelevated_ci
- windows_test_unelevated_others
if: always()
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@master
with:
needs_context: ${{ toJson(needs) }}