-
Notifications
You must be signed in to change notification settings - Fork 20
130 lines (122 loc) · 6.39 KB
/
build-and-test-windows.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
name: Build and Test Windows
# Windows builds are only run on-demand, to be run once before merging a PR, and for pushes to dev. This is because
# Windows builds are much slower and more expensive than Ubuntu ones, and them catching issues that aren't surfaced
# under Ubuntu is rare (but does happen). So, not running them for every push of every PR.
on:
workflow_dispatch:
pull_request:
types: [labeled]
push:
branches:
- dev
pull_request_review:
types: [submitted]
jobs:
remove-run-windows-build-label:
if: github.ref_name != github.event.repository.default_branch &&
github.event.label.name == 'run-windows-build'
name: Remove Run Windows Build Label
runs-on: ubuntu-24.04
timeout-minutes: 2
steps:
- name: Remove Run Windows Build Label
uses: Lombiq/GitHub-Actions/.github/actions/add-remove-label@dev
with:
# The token is necessary to be able to remove the label even if the workflow is triggered by a pull request
# coming from a fork.
token: ${{ secrets.LOMBIQBOT_GITHUB_PERSONAL_ACCESS_TOKEN }}
labels: run-windows-build
type: remove
build-and-test-larger-runners:
if: github.ref_name != github.event.repository.default_branch &&
(github.event_name == 'workflow_dispatch' ||
github.event.label.name == 'run-windows-build' ||
(github.event.review.state == 'APPROVED' && contains(github.event.pull_request.labels.*.name, 'requires-windows-build')))
name: Build and Test Windows - root solution (larger runners)
uses: Lombiq/GitHub-Actions/.github/workflows/build-and-test-orchard-core.yml@dev
with:
parent-job-name: root-solution-larger-runners
machine-types: '["windows-2022-8core"]'
timeout-minutes: 50
set-up-sql-server: 'true'
set-up-azurite: 'true'
build-create-binary-log: 'true'
dotnet-test-process-timeout: 720000
# Running ZAP for security scans in Docker under GHA Windows runners won't work since such virtualization is not
# supported by GHA.
# The currently used Elasticsearch setup action (https://github.com/elastic/elastic-github-actions/tree/master/elasticsearch)
# can only be used on Linux.
test-filter: FullyQualifiedName!~SecurityScanningTests&FullyQualifiedName!~BehaviorElasticsearchTests
build-and-test-standard-runners:
if: github.ref_name == github.event.repository.default_branch
name: Build and Test Windows - root solution (standard runners)
uses: Lombiq/GitHub-Actions/.github/workflows/build-and-test-orchard-core.yml@dev
with:
parent-job-name: root-solution-standard-runners
# Since dev builds are not awaited by anyone, they can run on the slower free runners.
machine-types: '["windows-2022"]'
timeout-minutes: 70
set-up-sql-server: 'true'
set-up-azurite: 'true'
build-create-binary-log: 'true'
dotnet-test-process-timeout: 840000
# Running ZAP for security scans in Docker under GHA Windows runners won't work since such virtualization is not
# supported by GHA.
# The currently used Elasticsearch setup action (https://github.com/elastic/elastic-github-actions/tree/master/elasticsearch)
# can only be used on Linux.
test-filter: FullyQualifiedName!~SecurityScanningTests&FullyQualifiedName!~BehaviorElasticsearchTests
build-and-test-nuget-test:
if: github.ref_name == github.event.repository.default_branch ||
github.event_name == 'workflow_dispatch' ||
github.event.label.name == 'run-windows-build' ||
(github.event.review.state == 'APPROVED' && contains(github.event.pull_request.labels.*.name, 'requires-windows-build'))
name: Build and Test Windows - NuGetTest solution
uses: Lombiq/GitHub-Actions/.github/workflows/build-and-test-orchard-core.yml@dev
with:
parent-job-name: nuget-solution
machine-types: '["windows-2022"]'
build-directory: NuGetTest
timeout-minutes: 30
dotnet-test-process-timeout: 540000
# Running ZAP for security scans in Docker under GHA Windows runners won't work since such virtualization is not
# supported by GHA.
# The currently used Elasticsearch setup action (https://github.com/elastic/elastic-github-actions/tree/master/elasticsearch)
# can only be used on Linux.
# Without quotes, somehow the value won't be passed properly and the test execution will hang, despite seemingly
# every value being the same as with quotes.
# yamllint disable-line rule:quoted-strings
test-filter: 'FullyQualifiedName!~SecurityScanningTests&FullyQualifiedName!~BehaviorElasticsearchTests'
powershell-static-code-analysis:
if: github.ref_name == github.event.repository.default_branch ||
github.event_name == 'workflow_dispatch' ||
github.event.label.name == 'run-windows-build' ||
(github.event.review.state == 'APPROVED' && contains(github.event.pull_request.labels.*.name, 'requires-windows-build'))
name: PowerShell Static Code Analysis Windows
uses: Lombiq/PowerShell-Analyzers/.github/workflows/static-code-analysis.yml@dev
with:
machine-types: '["windows-2022"]'
run-windows-powershell: 'false'
post-pull-request-checks-automation:
name: Post Pull Request Checks Automation
needs: [build-and-test-larger-runners, build-and-test-nuget-test, powershell-static-code-analysis]
if: github.event.pull_request != ''
uses: Lombiq/GitHub-Actions/.github/workflows/post-pull-request-checks-automation.yml@dev
secrets:
JIRA_BASE_URL: ${{ secrets.DEFAULT_JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.DEFAULT_JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.DEFAULT_JIRA_API_TOKEN }}
MERGE_TOKEN: ${{ secrets.LOMBIQBOT_GITHUB_PERSONAL_ACCESS_TOKEN }}
remove-windows-build-warning-label:
name: Remove Windows Build Warning Label
runs-on: ubuntu-24.04
timeout-minutes: 2
needs: [build-and-test-larger-runners, build-and-test-nuget-test, powershell-static-code-analysis]
steps:
- name: Remove Windows Build Warning Label
uses: Lombiq/GitHub-Actions/.github/actions/add-remove-label@dev
with:
# The token is necessary to be able to remove the label even if the workflow is triggered by a pull request
# coming from a fork.
token: ${{ secrets.LOMBIQBOT_GITHUB_PERSONAL_ACCESS_TOKEN }}
labels: requires-windows-build
type: remove