forked from kcp-dev/kcp
-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (146 loc) · 3.85 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
- 'release-*'
pull_request:
branches:
- main
- 'release-*'
paths-ignore:
- "docs/**"
- "**/*.md"
- ".github/ISSUE_TEMPLATE/*"
# NOTE!!!
#
# If you add a job here that is a REQUIRED status check in GitHub, you MUST add a job with the same name to ci-docs-only.yaml
#
# NOTE!!!
env:
# etcd uses fsync by default, disable it for running on github actions to avoid disk contention
# xref: https://github.com/kcp-dev/kcp/pull/435/commits/064a517747d69c2cd8f7f8b4a595ad909e595c89
UNSAFE_E2E_HACK_DISABLE_ETCD_FSYNC: true
jobs:
boilerplate:
name: boilerplate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: kcp
- uses: actions/checkout@v2
with:
repository: kubernetes/repo-infra
ref: master
path: repo-infra
fetch-depth: 1
- run: |
cd kcp
./../repo-infra/hack/verify_boilerplate.py --boilerplate-dir=hack/boilerplate
imports:
name: imports
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: kcp
- uses: actions/setup-go@v2
with:
go-version: v1.17
- name: Check imports
run: |
cd kcp
make imports
if ! git diff --exit-code; then
echo "imports are out of date, run make imports"
exit 1
fi
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: v1.17
- name: Run golangci-lint
run: make lint
codegen:
name: codegen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: v1.17
- name: Download modules
run: go mod download
- name: Check codegen
run: make verify-codegen
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: v1.17
- run: make build
- run: PATH="${PATH}:$(pwd)/bin/" make test
e2e:
name: e2e
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: v1.17
- run: make build
- run: ARTIFACT_DIR=/tmp/e2e PATH="${PATH}:$(pwd)/bin/" E2E_PARALLELISM=2 make test-e2e
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: e2e-artifacts
path: /tmp/e2e/**/artifacts/
e2e-multiple-runs:
name: e2e-multiple-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: v1.17
- run: make build
- run: ARTIFACT_DIR=/tmp/e2e PATH="${PATH}:$(pwd)/bin/" COUNT=5 E2E_PARALLELISM=2 make test-e2e
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: e2e-artifacts
path: /tmp/e2e/**/artifacts/
e2e-shared-server:
name: e2e-shared-server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: v1.17
- run: make build
- run: |-
export LOG_DIR=/tmp/e2e/shared-server/artifacts &&
mkdir -p ${LOG_DIR} &&
NO_GORUN=1 ./bin/test-server \
> ${LOG_DIR}/kcp.log 2>&1 &
- run: |-
ARTIFACT_DIR=/tmp/e2e \
PATH="${PATH}:$(pwd)/bin/" \
TEST_ARGS='-args --use-default-server' \
COUNT=1 \
E2E_PARALLELISM=2 \
make test-e2e
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: e2e-artifacts
path: /tmp/e2e/**/artifacts/