Skip to content

Commit 10eab21

Browse files
committed
Cleanup CI
Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent b97a56b commit 10eab21

4 files changed

Lines changed: 10 additions & 72 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ on:
33
push:
44
branches:
55
- main
6-
- master
76
- 'release/**'
87
pull_request:
98
branches:
109
- main
11-
- master
1210
- 'release/**'
1311

1412
jobs:
@@ -27,19 +25,9 @@ jobs:
2725

2826
steps:
2927
- uses: actions/checkout@v2
30-
with:
31-
path: src/github.com/containerd/containerd
32-
33-
- name: Set env
34-
shell: bash
35-
run: |
36-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
37-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
38-
3928
- uses: golangci/golangci-lint-action@v2
4029
with:
4130
version: v1.36.0
42-
working-directory: src/github.com/containerd/containerd
4331
args: --timeout=5m
4432

4533
#
@@ -55,11 +43,6 @@ jobs:
5543
with:
5644
go-version: '1.16.6'
5745

58-
- shell: bash
59-
run: |
60-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
61-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
62-
6346
- uses: actions/checkout@v2
6447
with:
6548
path: src/github.com/containerd/containerd
@@ -124,21 +107,9 @@ jobs:
124107
- uses: actions/setup-go@v2
125108
with:
126109
go-version: '1.16.6'
127-
128-
- name: Set env
129-
shell: bash
130-
run: |
131-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
132-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
133-
134110
- uses: actions/checkout@v2
135-
with:
136-
path: src/github.com/containerd/containerd
137-
138-
- run: GO111MODULE=on go get github.com/cpuguy83/go-md2man/[email protected]
139-
111+
- run: go get github.com/cpuguy83/go-md2man/[email protected]
140112
- run: make man
141-
working-directory: src/github.com/containerd/containerd
142113

143114
# Make sure binaries compile with other platforms
144115
crossbuild:
@@ -170,14 +141,7 @@ jobs:
170141
- uses: actions/setup-go@v2
171142
with:
172143
go-version: '1.16.6'
173-
- name: Set env
174-
shell: bash
175-
run: |
176-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
177-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
178144
- uses: actions/checkout@v2
179-
with:
180-
path: src/github.com/containerd/containerd
181145
- run: |
182146
set -e -x
183147
@@ -211,9 +175,8 @@ jobs:
211175
if [ -n "${packages}" ]; then
212176
sudo apt-get update && sudo apt-get install -y ${packages}
213177
fi
214-
name: install deps
178+
name: Install deps
215179
- name: Build
216-
working-directory: src/github.com/containerd/containerd
217180
env:
218181
GOOS: ${{matrix.goos}}
219182
GOARCH: ${{matrix.goarch}}
@@ -364,24 +327,17 @@ jobs:
364327
go-version: '1.16.6'
365328

366329
- uses: actions/checkout@v2
367-
with:
368-
path: src/github.com/containerd/containerd
369-
370-
- name: Set env
371-
run: |
372-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
373-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
374330

375331
- name: Install containerd dependencies
376332
env:
377333
RUNC_FLAVOR: ${{ matrix.runc }}
334+
GOFLAGS: -modcacherw
378335
run: |
379336
sudo apt-get install -y gperf
380337
sudo -E PATH=$PATH script/setup/install-seccomp
381338
sudo -E PATH=$PATH script/setup/install-runc
382-
sudo -E PATH=$PATH script/setup/install-cni
339+
sudo -E PATH=$PATH script/setup/install-cni $(grep containernetworking/plugins go.mod | awk '{print $2}')
383340
sudo -E PATH=$PATH script/setup/install-critools
384-
working-directory: src/github.com/containerd/containerd
385341
386342
- name: Install criu
387343
run: |
@@ -393,20 +349,17 @@ jobs:
393349
env:
394350
CGO_ENABLED: 1
395351
run: |
396-
make binaries
352+
make binaries GO_BUILD_FLAGS="-mod=vendor"
397353
sudo -E PATH=$PATH make install
398-
working-directory: src/github.com/containerd/containerd
399354
400355
- run: sudo -E PATH=$PATH script/setup/install-gotestsum
401-
working-directory: src/github.com/containerd/containerd
402356
- name: Tests
403357
env:
404358
GOPROXY: direct
405359
GOTESTSUM_JUNITFILE: ${{github.workspace}}/test-unit-root-junit.xml
406360
run: |
407361
make test
408362
sudo -E PATH=$PATH make root-test
409-
working-directory: src/github.com/containerd/containerd
410363
411364
- name: Integration 1
412365
env:
@@ -420,7 +373,6 @@ jobs:
420373
extraflags="EXTRA_TESTFLAGS=-no-criu";
421374
}
422375
sudo -E PATH=$PATH make integration ${extraflags} TESTFLAGS_RACE=-race
423-
working-directory: src/github.com/containerd/containerd
424376
425377
# Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/1759
426378
- name: Integration 2
@@ -435,14 +387,12 @@ jobs:
435387
extraflags="EXTRA_TESTFLAGS=-no-criu";
436388
}
437389
sudo -E PATH=$PATH TESTFLAGS_PARALLEL=1 make integration ${extraflags}
438-
working-directory: src/github.com/containerd/containerd
439390
440391
- name: CRI Integration Test
441392
env:
442393
TEST_RUNTIME: ${{ matrix.runtime }}
443394
run: |
444395
CONTAINERD_RUNTIME=$TEST_RUNTIME make cri-integration
445-
working-directory: src/github.com/containerd/containerd
446396
447397
- name: cri-tools critest
448398
env:
@@ -494,25 +444,13 @@ jobs:
494444
- uses: actions/setup-go@v2
495445
with:
496446
go-version: '1.16.6'
497-
498447
- uses: actions/checkout@v2
499-
with:
500-
path: src/github.com/containerd/containerd
501-
502-
- name: Set env
503-
run: |
504-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
505-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
506-
507448
- run: sudo -E PATH=$PATH script/setup/install-gotestsum
508-
working-directory: src/github.com/containerd/containerd
509449
- name: Tests
510450
env:
511451
GOPROXY: direct
512452
GOTESTSUM_JUNITFILE: "${{ github.workspace }}/macos-test-junit.xml"
513-
run: |
514-
make test
515-
working-directory: src/github.com/containerd/containerd
453+
run: make test
516454
- uses: actions/upload-artifact@v2
517455
if: always()
518456
with:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ genman: man/containerd.8 man/ctr.8
252252

253253
man/containerd.8: FORCE
254254
@echo "$(WHALE) $@"
255-
$(GO) run ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D)
255+
$(GO) run -mod=readonly ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D)
256256

257257
man/ctr.8: FORCE
258258
@echo "$(WHALE) $@"
259-
$(GO) run ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D)
259+
$(GO) run -mod=readonly ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D)
260260

261261
man/%: docs/man/%.md FORCE
262262
@echo "$(WHALE) $@"

script/setup/install-cni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#
2222
set -eu -o pipefail
2323

24-
CNI_COMMIT=$(grep containernetworking/plugins "$GOPATH"/src/github.com/containerd/containerd/go.mod | awk '{print $2}')
24+
CNI_COMMIT=${1:-$(grep containernetworking/plugins "$GOPATH"/src/github.com/containerd/containerd/go.mod | awk '{print $2}')}
2525
CNI_DIR=${DESTDIR:=''}/opt/cni
2626
CNI_CONFIG_DIR=${DESTDIR}/etc/cni/net.d
2727

script/setup/install-critools

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -eu -o pipefail
2222

2323
script_dir="$(cd -- "$(dirname -- "$0")" > /dev/null 2>&1; pwd -P)"
2424

25-
cd "$GOPATH"
25+
cd "$(go env GOPATH)"
2626
go get -u github.com/onsi/ginkgo/ginkgo
2727

2828
: "${CRITEST_COMMIT:=$(cat "${script_dir}/critools-version")}"

0 commit comments

Comments
 (0)