-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
164 lines (152 loc) · 4.08 KB
/
.gitlab-ci.yml
File metadata and controls
164 lines (152 loc) · 4.08 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
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
stages:
- tests
- build
- deploylocal
- deploy
- release
pester_test:
stage: tests
tags:
- windows
script:
- echo "Running tests -> pester_test"
- pwsh
- install-module -name 'pester' -RequiredVersion '5.5.0' -Repository 'psgallery' -confirm:$false
- Import-Module -name pester -RequiredVersion '5.5.0'
- invoke-Pester -Script .\test\Test-Unit-Pester.ps1 -CI || exit 1
# Pester Test Stage
pester_test_coverage:
stage: tests
tags:
- windows
script:
- echo "Running tests -> pester_test_coverage"
- pwsh
- install-module -name 'pester' -RequiredVersion '5.5.0' -Repository 'psgallery' -confirm:$false
- Import-Module -name pester -RequiredVersion '5.5.0'
- invoke-Pester -Script .\build\bt0-ci-test-pester.ps1 -CI || exit 1
artifacts:
paths:
- ./coverage.xml
# Script Analyzer Test Stage
script_analyzer:
stage: tests
tags:
- windows
script:
- echo "Running tests -> script_analyzer"
- pwsh
- find-module -name PSScriptAnalyzer -Repository PSGallery | install-module -Scope CurrentUser -Force -SkipPublisherCheck
- Import-Module -Name PSScriptAnalyzer
- .\build\bt1-p2-ci-test-pssa.ps1
artifacts:
paths:
- ./coverage.xml
# Build Module Stage
build_module:
stage: build
tags:
- windows
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_BUILD_STAGE == "tests" && $CI_BUILD_STATUS == "success"'
script:
- pwsh
- Find-Module -name 'psmpacker' -repository 'powershell' | install-Module -force
- import-module -name 'psmpacker'
- .\build\bt1-ci-build-module.ps1
artifacts:
paths:
- ./dist/*
- ./coverage.xml
# Create Nuget Package Stage
create_nuget:
stage: build
tags:
- windows
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_BUILD_STAGE == "tests" && $CI_BUILD_STATUS == "success"'
script:
- pwsh.exe
- find-Module -Repository 'powershell' -Name 'nupsforge' | Install-module -force
- Import-Module -Name 'nupsforge' -force
- .\build\bt2-ci-create-packages.ps1
artifacts:
paths:
- ./dist/*
- ./coverage.xml
# Deploy GitLab Package Stage
deploy_gitlab:
stage: deploylocal
tags:
- windows
script:
- pwsh.exe
- .\build\bt3-ci-deploy-pushtogitlab.ps1
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_BUILD_STAGE == "build" && $CI_BUILD_STATUS == "success"'
artifacts:
paths:
- ./dist/*
- ./coverage.xml
# Deploy Proget Packages Stage
deploy_proget:
stage: deploylocal
tags:
- windows
script:
- pwsh.exe
- .\build\bt4-ci-deploy-pushtoproget.ps1
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_BUILD_STAGE == "build" && $CI_BUILD_STATUS == "success"'
artifacts:
paths:
- ./dist/*
- ./coverage.xml
# Deploy Chocolatey Package Stage
deploy_chocolatey:
stage: deploy
tags:
- windows
script:
- pwsh.exe
- .\build\BT5-CI-deploy-PushToChoco.ps1
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_BUILD_STAGE == "deploylocal" && $CI_BUILD_STATUS == "success"'
artifacts:
paths:
- ./dist/*
- ./coverage.xml
# Deploy PSGallary Package Stage
deploy_psgallary:
stage: deploy
tags:
- windows
script:
- pwsh.exe
- .\build\bt6-ci-deploy-psgallary.ps1
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_BUILD_STAGE == "deploylocal" && $CI_BUILD_STATUS == "success"'
# Create Release Stage
create_release:
stage: release
tags:
- windows
script:
- pwsh.exe
- Compress-Archive -Path .\ -DestinationPath Build.gz
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_BUILD_STAGE == "deploy" && $CI_BUILD_STATUS == "success"'
artifacts:
paths:
- Build.gz
- ./dist/*
# Deploy Coverage to Coverails.io Stage
deploy_coverage:
stage: release
tags:
- windows
script:
- pwsh.exe
- .\bt8-ci-deploy-coveralls-report.ps1
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_BUILD_STAGE == "deploy" && $CI_BUILD_STATUS == "success"'