This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 348
188 lines (160 loc) · 5.27 KB
/
ci.yml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: CI
on: [push, pull_request]
jobs:
#
# Project checks
#
project:
name: Project Checks (DCO, Headers, Vendor)
runs-on: ubuntu-18.04
timeout-minutes: 5
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: '1.15.14'
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Checkout cri repo
uses: actions/checkout@v2
with:
path: ${{github.workspace}}/src/github.com/containerd/cri
fetch-depth: 150
- name: Checkout project repo
uses: actions/checkout@v2
with:
repository: containerd/project
path: src/github.com/containerd/project
#
# Go get dependencies
#
- name: Install go get dependencies
env:
GO111MODULE: off
run: |
go get -u github.com/vbatts/git-validation
go get -u github.com/kunalkushwaha/ltag
go get -u github.com/LK4D4/vndr
#
# DCO / File headers / Vendor directory validation
#
- name: DCO
env:
GITHUB_COMMIT_URL: ${{ github.event.pull_request.commits_url }}
DCO_VERBOSITY: "-v"
DCO_RANGE: ""
working-directory: src/github.com/containerd/cri
run: |
set -x
if [ -z "${GITHUB_COMMIT_URL}" ]; then
DCO_RANGE=$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH})
else
DCO_RANGE=$(curl ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha +".."+ .[-1].sha')
fi
../project/script/validate/dco
- name: Headers
working-directory: src/github.com/containerd/cri
run: |
ltag -t "../project/script/validate/template" --check -v
- name: Vendor
working-directory: src/github.com/containerd/cri
run: ../project/script/validate/vendor
#
# build, unit, integration, and CRI tests
#
linux-build-and-test:
name: Build, Unit, Integration, and CRI (linux amd64)
runs-on: ubuntu-18.04
strategy:
matrix:
runtime: [io.containerd.runtime.v1.linux, io.containerd.runc.v1, io.containerd.runc.v2]
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: '1.15.14'
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Checkout cri repo
uses: actions/checkout@v2
with:
path: ${{github.workspace}}/src/github.com/containerd/cri
fetch-depth: 150
- name: Before install
run: |
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
btrfs-tools \
libseccomp2 \
libseccomp-dev
make install.deps
working-directory: ${{github.workspace}}/src/github.com/containerd/cri
- name: Install containerd
run: |
make containerd
sudo PATH=$PATH GOPATH=$GOPATH make install-containerd
working-directory: ${{github.workspace}}/src/github.com/containerd/cri
- name: Unit Test
run: |
make test
working-directory: ${{github.workspace}}/src/github.com/containerd/cri
- name: Integration Test
env:
TEST_RUNTIME: ${{ matrix.runtime }}
run: |
CONTAINERD_RUNTIME=$TEST_RUNTIME make test-integration
working-directory: ${{github.workspace}}/src/github.com/containerd/cri
- name: Upload Integration Log File
uses: actions/upload-artifact@v1
with:
name: integration-test-${{github.sha}}.log
path: /tmp/test-integration/containerd.log
- name: CRI Test
run: |
make test-cri
working-directory: ${{github.workspace}}/src/github.com/containerd/cri
- name: Upload CRI Test log file
uses: actions/upload-artifact@v1
with:
name: cri-test-${{github.sha}}.log
path: /tmp/test-cri/containerd.log
test-windows:
name: Build and CRI Test (Windows amd64)
runs-on: windows-2016
steps:
- name: Set up Go 1.15.14
uses: actions/setup-go@v1
with:
go-version: 1.15.14
- name: Checkout cri repo
uses: actions/checkout@v2
with:
path: ${{github.workspace}}\\src\\github.com\\containerd\\cri
- name: Clone containerd repo
shell: bash
run: |
GO111MODULE=off go get github.com/containerd/containerd
- name: Configure Windows environment variables
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Build
shell: bash
run: |
pwd && ./test/windows/test.sh
working-directory: ${{github.workspace}}\\src\\github.com\\containerd\\cri
- name: Upload containerd log file
uses: actions/upload-artifact@v1
with:
name: cadvisor-${{github.sha}}.log
path: c:\\_artifacts\\containerd.log