-
Notifications
You must be signed in to change notification settings - Fork 312
121 lines (110 loc) · 3.76 KB
/
integrate-cluster-cmd.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
---
name: integrate-cluster-cmd
on:
schedule:
# times are in UTC
- cron: '19 21 * * *'
pull_request:
branches:
- master
- release-*
paths-ignore:
- '**.html'
- '**.md'
- 'CNAME'
- 'LICENSE'
- 'doc/**'
- 'embed/templates/examples/**'
- 'components/client/**'
- 'components/ctl/**'
- 'components/dm/**'
- 'components/doc/**'
- 'components/errdoc/**'
- 'components/playground/**'
- 'server/**'
- 'pkg/version/version.go'
- '.github/workflows/integrate-tiup**'
- '.github/workflows/integrate-dm**'
- '.github/workflows/integrate-playground**'
jobs:
cluster:
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
cases:
- 'test_cmd'
# - 'test_cmd_tls_native_ssh'
- 'test_upgrade'
- 'test_upgrade_tls'
- 'test_tikv_cdc'
env:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.21.x
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
- name: Build build_integration_test
working-directory: ${{ env.working-directory }}
run: |
export GOPATH=${GITHUB_WORKSPACE}/go
export PATH=$PATH:$GOPATH/bin
make build_integration_test
- name: Build the docker-compose stack
working-directory: ${{ env.working-directory }}
# with --dev the first run will fail for unknow reason, just retry it and will success now..
run: TIUP_CLUSTER_ROOT=${{ env.working-directory }} ./docker/up.sh --daemon --dev || TIUP_CLUSTER_ROOT=${{ env.working-directory }} ./docker/up.sh --daemon --dev
- name: Check running containers
run: |
docker ps
df -h
free -h
- name: Run test suite
id: test
working-directory: ${{ env.working-directory }}
run: |
# ensuere docker ssh is ready
sleep 3
# should not use -it
# ref: https://stackoverflow.com/questions/43099116/error-the-input-device-is-not-a-tty
docker exec tiup-cluster-control bash /tiup-cluster/tests/tiup-cluster/run.sh ${{ matrix.cases }}
- name: Collect component log
working-directory: ${{ env.working-directory }}
# if: always()
run: |
docker exec tiup-cluster-control bash /tiup-cluster/tests/tiup-cluster/script/pull_log.sh /tiup-cluster/logs
ls ${{ env.working-directory }}
- name: Detect error log
working-directory: ${{ env.working-directory }}
# if: always()
run: |
bash ./tests/tiup-cluster/script/detect_error.sh ./logs/
- name: Upload component log
if: ${{ failure() }}
# if: always()
uses: actions/upload-artifact@v3
with:
name: component_logs
path: ${{ env.working-directory }}/logs/
- name: Output cluster debug log
working-directory: ${{ env.working-directory }}
if: always()
run: |
pwd
docker ps
df -h
free -h
find ${{ env.working-directory }}/logs -type f -exec sh -c 'echo "{}" && cat {} && echo "\n"' \; || true
- name: Upload coverage to Codecov
working-directory: ${{ env.working-directory }}
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -F cluster -s ${{ env.working-directory }}/tests/tiup-cluster/cover -f '*.out'