forked from kcp-dev/kcp
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (80 loc) · 1.92 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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
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
- uses: golangci/golangci-lint-action@v2
with:
only-new-issues: true
args: --timeout=5m
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: ARTIFACT_DIR=/tmp/e2e PATH="${PATH}:$(pwd)/bin/" make test
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: e2e-artifacts
path: /tmp/e2e/**/artifacts/