-
Notifications
You must be signed in to change notification settings - Fork 240
Expand file tree
/
Copy pathblobfuse2-1es_ci.yaml
More file actions
172 lines (157 loc) · 5.57 KB
/
blobfuse2-1es_ci.yaml
File metadata and controls
172 lines (157 loc) · 5.57 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
165
166
167
168
169
170
171
172
# Do not trigger this pipeline automatically
trigger: none
# Execute this for every PR on main
pr:
branches:
include:
- main
paths:
exclude:
- README.md
- CHANGELOG.md
- MIGRATION.md
- SECURITY.md
- NOTICE
- LICENSE
- CODE_OF_CONDUCT.md
- TSG.md
- setup/readme.md
- doc/**
- guide/**
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
# The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
# For non-production pipelines, use "Unofficial" as defined below.
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
# The SDL Source analysis stage can only run in a windows environment due to limitations of Guardian tools.
# If you use Linux pool, we require an additional windows image in your pool to run the source analysis.
sdl:
sourceAnalysisPool:
name: blobfuse2-pool # Name of your hosted pool
image: windows2022-1espt
os: windows # OS of the image. Allowed values: windows, linux, macOS
stages:
- stage: CI
jobs:
- job: test
displayName: blobfuse
strategy:
matrix:
Ubuntu-20:
AgentName: 'ubn20-custom1espt'
distro: 'ubuntu'
distro_version: 'ubuntu_20'
poolName: 'blobfuse2-pool'
fuselib: 'libfuse-dev'
tags: 'fuse2'
adlsSas: $(AZTEST_ADLS_CONT_SAS_UBN_20)
Ubuntu-22:
AgentName: 'ubuntu22-1espt'
distro: 'ubuntu'
distro_version: 'ubuntu_22_x86'
poolName: 'blobfuse2-pool'
fuselib: 'libfuse3-dev'
tags: 'fuse3'
adlsSas: $(AZTEST_ADLS_CONT_SAS_UBN_22)
Ubuntu-22-ARM64:
AgentName: 'ubn22armblobfuse-1espt'
distro: 'ubuntu'
distro_version: 'ubuntu_22_arm'
poolName: 'blobfuse2-arm-pool'
fuselib: 'libfuse3-dev'
tags: 'fuse3'
adlsSas: $(AZTEST_ADLS_CONT_SAS_UBN_22)
pool:
name: $(poolName)
os: linux
demands:
- ImageOverride -equals $(AgentName)
variables:
- group: NightlyBlobFuse
- name: ROOT_DIR
value: '$(Agent.TempDirectory)'
- name: WORK_DIR
value: '$(Build.SourcesDirectory)'
- name: TEMP_DIR
value: '$(Agent.TempDirectory)'
- name: MOUNT_DIR
value: '$(Agent.TempDirectory)/blob_mnt'
- name: GOPATH
value: '$(Agent.TempDirectory)/go'
steps:
# Pull and build the code, Run the Unit Tests
- template: 'azure-pipeline-templates/build.yml@self'
parameters:
skip_azcli: "false"
skip_ut: "false"
# Code lint checks (Static-analysis)
- script: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
$(go env GOPATH)/bin/golangci-lint --version
$(go env GOPATH)/bin/golangci-lint run --build-tags $(tags) > lint.log
result=$(cat lint.log | wc -l)
if [ $result -ne 1 ]; then
echo "-----------------------------------"
echo "Below issues are found in SA"
cat lint.log
echo "-----------------------------------"
exit 1
else
echo "-----------------------------------"
echo "No issues are found in SA"
echo "-----------------------------------"
fi
displayName: 'Static Analysis (Lint)'
condition: always()
workingDirectory: $(WORK_DIR)
# Copyright checks
- script: |
result=$(grep -L -r --include \*.go "`date +%Y` Microsoft Corporation" ./ | wc -l)
if [ $result -ne 0 ]; then
exit 1
else
echo "Copyright statements are up to date"
fi
displayName: 'Copyright check'
condition: always()
failOnStderr: true
workingDirectory: $(WORK_DIR)
# Go code formatting checks
- script: |
gofmt -s -l -d . | tee >&2
displayName: 'Go Format Check'
failOnStderr: true
workingDirectory: $(WORK_DIR)
# Notices files check
- script: |
./notices_fix.sh
result=$(git diff NOTICE | wc -l)
if [ $result -gt 12 ]; then
echo "Notices needs a fix. Run ./notices_fix.sh and commit NOTICE file."
exit 1
else
echo "Notices are up to date."
fi
displayName: 'Notice file check'
condition: always()
failOnStderr: true
workingDirectory: $(WORK_DIR)
# CleanUp the mount and delete the containers.
- template: 'azure-pipeline-templates/cleanup.yml@self'
parameters:
unmount: false
delete_containers: true
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
displayName: "Component governance"
condition: always()