-
Notifications
You must be signed in to change notification settings - Fork 927
90 lines (90 loc) · 2.4 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
name: CI Workflow
on:
# Run this workflow every time a new commit pushed to upstream/fork repository.
# Run workflow on fork repository will help contributors find and resolve issues before sending a PR.
push:
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-18.04
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: vendor
run: hack/verify-vendor.sh
- name: lint
run: hack/verify-staticcheck.sh
- name: import alias
run: hack/verify-import-aliases.sh
codegen:
name: codegen
runs-on: ubuntu-18.04
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: verify codegen
run: hack/verify-codegen.sh
- name: verify crdgen
run: hack/verify-crdgen.sh
build:
name: compile
needs: codegen # rely on codegen successful completion
runs-on: ubuntu-18.04
steps:
- name: checkout code
uses: actions/checkout@v2
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# We need to guess version via git tags.
fetch-depth: 0
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: compile
run: make all
test:
name: unit test
needs: build
runs-on: ubuntu-18.04
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: make test
run: make test
e2e:
name: e2e test
needs: build
runs-on: ubuntu-18.04
env:
ARTIFACTS_PATH: ${{ github.workspace }}/karmada-e2e-logs/
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: setup e2e test environment
run: hack/local-up-karmada.sh
- name: run e2e
run: hack/run-e2e.sh
- name: upload logs
if: always()
uses: actions/upload-artifact@v2
with:
name: karmada_e2e_log
path: ${{ github.workspace }}/karmada-e2e-logs/