forked from chaos-mesh/chaosd
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 1.63 KB
/
Copy pathci.yml
File metadata and controls
60 lines (55 loc) · 1.63 KB
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
name: ci
on:
pull_request:
branches:
- main
- release-*
jobs:
pull:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
job:
- verify
- build
- unit-test
- integration-test
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v1
with:
go-version: 1.16.2
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: ${{ matrix.job }}
run: |
# workaround for https://github.com/actions/setup-go/issues/14
export GOPATH=${GITHUB_WORKSPACE}/go
export PATH=$PATH:$GOPATH/bin
#use sh function
if [[ "$job" == "verify" ]]; then
# preload go modules before goimports
go mod download -x
make check
make groupimports || echo 0
echo "Please make check before creating a PR"
git diff --quiet -- . || (git diff | cat && false)
elif [[ "$job" == "build" ]]; then
make build
elif [[ "$job" == "unit-test" ]]; then
make unit-test
elif [[ "$job" == "integration-test" ]]; then
sudo apt-get update
sudo apt-get install -y stress-ng
make integration-test
else
make $job
fi
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
env:
job: ${{ matrix.job }}