Skip to content

Commit f8e3c8f

Browse files
authored
Merge pull request #4637 from mxpv/ci
Cleanup CI
2 parents 7a0f91d + e8fe4b6 commit f8e3c8f

1 file changed

Lines changed: 72 additions & 101 deletions

File tree

.github/workflows/ci.yml

Lines changed: 72 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
- name: Set env
3232
shell: bash
3333
run: |
34-
echo "::set-env name=GOPATH::${{ github.workspace }}"
35-
echo "::add-path::${{ github.workspace }}/bin"
34+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
35+
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
3636
3737
- uses: golangci/golangci-lint-action@v2
3838
with:
@@ -48,6 +48,10 @@ jobs:
4848
runs-on: ubuntu-18.04
4949
timeout-minutes: 5
5050

51+
defaults:
52+
run:
53+
working-directory: src/github.com/containerd/containerd
54+
5155
steps:
5256
#
5357
# Install Go
@@ -57,12 +61,6 @@ jobs:
5761
with:
5862
go-version: '1.15.2'
5963

60-
- name: Set env
61-
shell: bash
62-
run: |
63-
echo "::set-env name=GOPATH::${{ github.workspace }}"
64-
echo "::add-path::${{ github.workspace }}/bin"
65-
6664
#
6765
# Checkout repos
6866
#
@@ -78,6 +76,12 @@ jobs:
7876
repository: containerd/project
7977
path: src/github.com/containerd/project
8078

79+
- name: Set env
80+
shell: bash
81+
run: |
82+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
83+
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
84+
8185
#
8286
# Go get dependencies
8387
#
@@ -97,7 +101,6 @@ jobs:
97101
GITHUB_COMMIT_URL: ${{ github.event.pull_request.commits_url }}
98102
DCO_VERBOSITY: "-q"
99103
DCO_RANGE: ""
100-
working-directory: src/github.com/containerd/containerd
101104
run: |
102105
set -x
103106
if [ -z "${GITHUB_COMMIT_URL}" ]; then
@@ -109,11 +112,9 @@ jobs:
109112
110113
- name: Headers
111114
run: ../project/script/validate/fileheader ../project/
112-
working-directory: src/github.com/containerd/containerd
113115

114116
- name: Vendor
115117
run: ../project/script/validate/vendor
116-
working-directory: src/github.com/containerd/containerd
117118

118119
#
119120
# Protobuf checks
@@ -123,79 +124,61 @@ jobs:
123124
runs-on: ubuntu-18.04
124125
timeout-minutes: 5
125126

127+
defaults:
128+
run:
129+
working-directory: src/github.com/containerd/containerd
130+
126131
steps:
127-
- name: Set up Go
128-
uses: actions/setup-go@v1
132+
- uses: actions/setup-go@v1
129133
with:
130134
go-version: '1.15.2'
131135

136+
- uses: actions/checkout@v2
137+
with:
138+
path: src/github.com/containerd/containerd
139+
132140
- name: Set env
133141
shell: bash
134142
run: |
135-
echo "::set-env name=GOPATH::${{ github.workspace }}"
136-
echo "::add-path::${{ github.workspace }}/bin"
137-
138-
- name: Checkout
139-
uses: actions/checkout@v2
140-
with:
141-
path: src/github.com/containerd/containerd
143+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
144+
echo "GO111MODULE=off" >> $GITHUB_ENV
145+
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
142146
143147
- name: Install protobuf
144-
env:
145-
GO111MODULE: off
146-
working-directory: src/github.com/containerd/containerd
147148
run: |
148149
sudo env PATH=$PATH GOPATH=$GOPATH script/setup/install-protobuf
149150
sudo chmod +x /usr/local/bin/protoc
150151
sudo chmod og+rx /usr/local/include/google /usr/local/include/google/protobuf /usr/local/include/google/protobuf/compiler
151152
sudo chmod -R og+r /usr/local/include/google/protobuf/
152153
protoc --version
153154
154-
- name: Install dev tools
155-
env:
156-
GO111MODULE: off
157-
run: script/setup/install-dev-tools
158-
working-directory: src/github.com/containerd/containerd
159-
160-
- name: Check fmt
161-
working-directory: src/github.com/containerd/containerd
162-
run: |
163-
make proto-fmt
164-
165-
- name: Check protos
166-
env:
167-
GO111MODULE: off
168-
working-directory: src/github.com/containerd/containerd
169-
run: |
170-
make check-protos check-api-descriptors
155+
- run: script/setup/install-dev-tools
156+
- run: make proto-fmt
157+
- run: make check-protos check-api-descriptors
171158

172159
man:
173160
name: Manpages
174161
runs-on: ubuntu-18.04
175162
timeout-minutes: 5
176163

177164
steps:
178-
- name: Install Go
179-
uses: actions/setup-go@v1
165+
- uses: actions/setup-go@v1
180166
with:
181167
go-version: '1.15.2'
182168

183169
- name: Set env
184170
shell: bash
185171
run: |
186-
echo "::set-env name=GOPATH::${{ github.workspace }}"
187-
echo "::add-path::${{ github.workspace }}/bin"
172+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
173+
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
188174
189-
- name: Checkout
190-
uses: actions/checkout@v2
175+
- uses: actions/checkout@v2
191176
with:
192177
path: src/github.com/containerd/containerd
193178

194-
- name: Install dependencies
195-
run: GO111MODULE=on go get github.com/cpuguy83/go-md2man/[email protected]
179+
- run: GO111MODULE=on go get github.com/cpuguy83/go-md2man/[email protected]
196180

197-
- name: Make
198-
run: make man
181+
- run: make man
199182
working-directory: src/github.com/containerd/containerd
200183

201184
#
@@ -212,19 +195,17 @@ jobs:
212195
os: [ubuntu-18.04, macos-10.15, windows-2019]
213196

214197
steps:
215-
- name: Install Go
216-
uses: actions/setup-go@v1
198+
- uses: actions/setup-go@v1
217199
with:
218200
go-version: '1.15.2'
219201

220202
- name: Set env
221203
shell: bash
222204
run: |
223-
echo "::set-env name=GOPATH::${{ github.workspace }}"
224-
echo "::add-path::${{ github.workspace }}/bin"
205+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
206+
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
225207
226-
- name: Checkout
227-
uses: actions/checkout@v2
208+
- uses: actions/checkout@v2
228209
with:
229210
path: src/github.com/containerd/containerd
230211

@@ -243,60 +224,56 @@ jobs:
243224
timeout-minutes: 30
244225
needs: [project, linters, protos, man]
245226

227+
defaults:
228+
run:
229+
shell: bash
230+
working-directory: src/github.com/containerd/containerd
231+
246232
steps:
247-
- name: Install Go
248-
uses: actions/setup-go@v1
233+
- uses: actions/setup-go@v1
249234
with:
250235
go-version: '1.15.2'
251236

252-
- name: Set env
253-
shell: bash
254-
run: |
255-
echo "::set-env name=GOPATH::${{ github.workspace }}"
256-
echo "::add-path::${{ github.workspace }}/src/github.com/containerd/containerd/bin"
257-
258-
- name: Checkout containerd
259-
uses: actions/checkout@v2
237+
- uses: actions/checkout@v2
260238
with:
261239
path: src/github.com/containerd/containerd
262-
- name: Checkout Microsoft/hcsshim
263-
uses: actions/checkout@v2
240+
241+
- uses: actions/checkout@v2
264242
with:
265243
repository: Microsoft/hcsshim
266244
path: src/github.com/Microsoft/hcsshim
267245

268-
- name: Install Build Deps
269-
shell: bash
246+
- name: Set env
270247
run: |
271-
cd src/github.com/containerd/containerd
272-
script/setup/install-dev-tools
248+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
249+
echo "${{ github.workspace }}/src/github.com/containerd/containerd/bin" >> $GITHUB_PATH
250+
251+
- run: script/setup/install-dev-tools
252+
273253
- name: Binaries
274-
shell: bash
254+
env:
255+
CGO_ENABLED: 1
275256
run: |
276257
set -o xtrace
277-
export CGO_ENABLED=1
278-
cd src/github.com/containerd/containerd
279258
mingw32-make.exe binaries
280259
bindir="$(pwd)"
281260
SHIM_COMMIT=$(grep Microsoft/hcsshim vendor.conf | awk '{print $2}')
282261
cd ../../Microsoft/hcsshim
283262
git fetch --tags origin "${SHIM_COMMIT}"
284263
git checkout "${SHIM_COMMIT}"
285264
GO111MODULE=on go build -mod=vendor -o "${bindir}/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1
265+
286266
- name: Integration 1
287-
shell: bash
288-
run: |
289-
cd src/github.com/containerd/containerd
290-
export CGO_ENABLED=1
291-
mingw32-make.exe integration
267+
env:
268+
CGO_ENABLED: 1
269+
run: mingw32-make.exe integration
270+
292271
# Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/175
293272
- name: Integration 2
294-
shell: bash
295-
run: |
296-
cd src/github.com/containerd/containerd
297-
export TESTFLAGS_PARALLEL=1
298-
export CGO_ENABLED=1
299-
mingw32-make.exe integration
273+
env:
274+
TESTFLAGS_PARALLEL: 1
275+
CGO_ENABLED: 1
276+
run: mingw32-make.exe integration
300277

301278
integration-linux:
302279
name: Linux Integration
@@ -315,13 +292,11 @@ jobs:
315292
runc: crun
316293

317294
steps:
318-
- name: Install Go
319-
uses: actions/setup-go@v1
295+
- uses: actions/setup-go@v1
320296
with:
321297
go-version: '1.15.2'
322298

323299
- name: Setup gosu
324-
shell: bash
325300
run: |
326301
GOSU=/usr/local/bin/gosu
327302
arch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"
@@ -330,17 +305,15 @@ jobs:
330305
sudo chown root ${GOSU}
331306
sudo chmod +s ${GOSU}
332307
333-
- name: Set env
334-
shell: bash
335-
run: |
336-
echo "::set-env name=GOPATH::${{ github.workspace }}"
337-
echo "::add-path::${{ github.workspace }}/bin"
338-
339-
- name: Checkout containerd
340-
uses: actions/checkout@v2
308+
- uses: actions/checkout@v2
341309
with:
342310
path: src/github.com/containerd/containerd
343311

312+
- name: Set env
313+
run: |
314+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
315+
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
316+
344317
- name: Install containerd dependencies
345318
env:
346319
RUNC_FLAVOR: ${{ matrix.runc }}
@@ -427,11 +400,9 @@ jobs:
427400
# We can enable crun again when we get a better CI infra.
428401
runc: [runc]
429402
steps:
430-
- name: Checkout containerd
431-
uses: actions/checkout@v2
403+
- uses: actions/checkout@v2
432404

433-
- name: Start vagrant
434-
run: vagrant up
405+
- run: vagrant up
435406

436407
- name: Integration
437408
env:

0 commit comments

Comments
 (0)