forked from chaos-mesh/chaos-mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 1.81 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
name: ci
on:
pull_request:
branches:
- master
- release-*
jobs:
pull:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
job:
- verify
- build
- test
steps:
- name: Set up Go 1.15
uses: actions/setup-go@v1
with:
go-version: 1.15.11
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
- name: Setup Helm
uses: azure/setup-helm@v1
with:
version: v3.3.0
- name: ${{ matrix.job }}
run: |
# workaround for https://github.com/actions/setup-go/issues/14
export GOPATH=${GITHUB_WORKSPACE}/go
export PATH=$PATH:$GOPATH/bin
make ensure-kubebuilder || echo 0
make ensure-kustomize || echo 0
# preload go modules before goimports
go mod download -x
make groupimports || echo 0
#use sh function
if [[ "$job" == "verify" ]]; then
make check
echo "Please make check before creating a PR"
git diff --quiet -- . || (git diff | cat && false)
make check-install-script
elif [[ "$job" == "build" ]]; then
make image
elif [[ "$job" == "test" ]]; then
ROOT=$(pwd)
KUBEBUILDER_ASSETS=${ROOT}/output/bin/kubebuilder/bin make test
BUILD_NUMBER=${BUILD_NUMBER} CODECOV_TOKEN="${CODECOV_TOKEN}" CI=1 make coverage
else
make $job
fi
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
env:
job: ${{ matrix.job }}