-
Notifications
You must be signed in to change notification settings - Fork 969
138 lines (123 loc) · 3.72 KB
/
unittests.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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: "unittests"
on:
push:
branches:
- 'main'
- 'release-*'
paths-ignore:
- 'docs/**'
- '**.md'
- '**.java'
- '**/pom.xml'
pull_request:
#The branches below must be a subset of the branches above
branches:
- 'main'
- 'release-*'
paths-ignore:
- 'docs/**'
- '**.md'
- '.github/**'
- '!.github/workflows/unittests.yml'
- '**.java'
- '**/pom.xml'
workflow_dispatch:
inputs:
debug:
type: boolean
description: "Run the build with tmate debugging enabled"
required: false
default: false
jobs:
unittests:
strategy:
fail-fast: false
matrix:
test: [ 'test.meta.core','test.meta.non-core','test.pkg','test.cmd', 'test.fdb' ]
timeout-minutes: 60
runs-on: ubuntu-20.04
env:
MINIO_TEST_BUCKET: 127.0.0.1:9000/testbucket
MINIO_ACCESS_KEY: testUser
MINIO_SECRET_KEY: testUserPassword
GLUSTER_VOLUME: jfstest/gv0
DISPLAY_PROGRESSBAR: false
HDFS_ADDR: localhost:8020
SFTP_HOST: localhost:2222:/home/testUser1/upload/
SFTP_USER: testUser1
SFTP_PASS: password
WEBDAV_TEST_BUCKET: 127.0.0.1:9007
TIKV_ADDR: 127.0.0.1
REDIS_ADDR: redis://127.0.0.1:6379/13
ETCD_ADDR: 127.0.0.1:3379
MYSQL_ADDR: (127.0.0.1:3306)/dev
MYSQL_USER: root
NFS_ADDR: 127.0.0.1:/srv/nfs/
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Build
timeout-minutes: 10
uses: ./.github/actions/build
with:
useBeta: true
- name: Install Packages
run: |
sudo .github/scripts/apt_install.sh g++-multilib redis-server libacl1-dev attr glusterfs-server libglusterfs-dev nfs-kernel-server
sudo mkdir -p /home/travis/.m2/
- if: matrix.test == 'test.pkg'
name: Set up nfs-server
run: |
sudo mkdir -p /srv/nfs
sudo chown nobody:nogroup /srv/nfs
sudo chmod 777 /srv/nfs
echo "/srv/nfs 127.0.0.1(rw,sync,insecure)" | sudo tee -a /etc/exports
sudo systemctl start nfs-kernel-server.service
sudo exportfs -arv
- if: matrix.test == 'test.meta.non-core'
name: Install redis-cluster
uses: vishnudxb/[email protected]
with:
master1-port: 7000
master2-port: 7001
master3-port: 7002
slave1-port: 7003
slave2-port: 7004
slave3-port: 7005
- name: Prepare Database
run: |
TEST=${{matrix.test}} ./.github/scripts/prepare_db.sh
- name: Unit Test
timeout-minutes: 30
run: |
test=${{matrix.test}}
make $test
- name: Code Coverage
uses: codecov/codecov-action@v3
with:
files: ./cov.out
- name: Setup upterm session
if: failure() && (github.event.inputs.debug == 'true' || github.run_attempt != 1)
timeout-minutes: 120
uses: lhotari/action-upterm@v1
success-all-test:
runs-on: ubuntu-latest
needs: [unittests]
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@v3
- uses: actions/checkout@v3
- name: Check Failure
if: env.WORKFLOW_CONCLUSION == 'failure'
run: exit 1
- name: Send Slack Notification
if: failure() && github.event_name != 'workflow_dispatch'
uses: juicedata/slack-notify-action@main
with:
channel-id: "${{ secrets.SLACK_CHANNEL_ID_FOR_PR_CHECK_NOTIFY }}"
slack_bot_token: "${{ secrets.SLACK_BOT_TOKEN }}"
- name: Success
if: success()
run: echo "All Done"