forked from eclipse-iofog/edgelet
-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (149 loc) · 4.61 KB
/
Copy pathci.yml
File metadata and controls
173 lines (149 loc) · 4.61 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
173
name: Edgelet CI
on:
push:
branches: [ main, develop, edgelet/** ]
paths:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- 'Makefile'
- 'scripts/**'
- 'scripts/assemble-install.sh'
- 'install.sh'
- 'uninstall.sh'
- 'packaging/**'
- 'build/Dockerfile.embedded'
- 'Dockerfile'
- 'docs/cli/**'
- '.github/**'
pull_request:
branches: [ main, develop, edgelet/** ]
paths:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- 'Makefile'
- 'scripts/**'
- 'scripts/assemble-install.sh'
- 'install.sh'
- 'uninstall.sh'
- 'packaging/**'
- 'build/Dockerfile.embedded'
- 'Dockerfile'
- 'docs/cli/**'
- '.github/**'
workflow_dispatch:
permissions: read-all
env:
GO_VERSION: '1.26.4'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: go.sum
- run: go version
- name: go vet
run: make vet
- name: golangci-lint
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
version: v2.12.2
args: --timeout=5m0s
- name: Static security analysis
run: make security-code
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: go.sum
- run: go version
- name: Run unit tests
run: make test-unit
- name: Fuzz smoke
run: go test -fuzz=FuzzFileMapFields -fuzztime=30s ./pkg/dataverify
- name: CLI docs drift gate
run: make cli-docs-check
- name: Install script assemble drift gate
run: make install-scripts-check
- name: CLI help regression
run: make cli-help-check
- name: EdgeletAPI v1 QA gates
run: |
chmod +x scripts/edgelet-api-v1-gates.sh
./scripts/edgelet-api-v1-gates.sh
- name: Check formatting
run: |
go fmt ./...
git diff --exit-code
embed-ci-amd64:
name: Embed pipeline amd64
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Install embed build deps
run: |
chmod +x scripts/install-embed-build-deps
sudo BUILDARCH=amd64 TARGETARCH=amd64 ./scripts/install-embed-build-deps
- name: Run scripts/ci (amd64)
run: |
chmod +x scripts/*
EDGELET_CI_ARCHES=amd64 ./scripts/ci
embed-ci-arm64:
name: Embed pipeline arm64
runs-on: ubuntu-24.04-arm
needs: [lint, test]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Install embed build deps
run: |
chmod +x scripts/install-embed-build-deps
sudo BUILDARCH=arm64 TARGETARCH=arm64 ./scripts/install-embed-build-deps
- name: Run scripts/ci (arm64)
run: |
chmod +x scripts/*
EDGELET_CI_ARCHES=arm64 ./scripts/ci
desktop-matrix:
name: Desktop build smoke (${{ matrix.goos }}/${{ matrix.goarch }})
runs-on: ubuntu-latest
needs: [test]
strategy:
fail-fast: false
matrix:
include:
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Build desktop edgelet (monolithic)
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
mkdir -p build
CGO_ENABLED=0 go build -trimpath \
-ldflags "-s -w" \
-o build/edgelet-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/edgelet