Skip to content

Commit 0bf5dcb

Browse files
authored
Add ci (#12)
1 parent 49a951f commit 0bf5dcb

File tree

9 files changed

+214
-4
lines changed

9 files changed

+214
-4
lines changed

.github/.codespellrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[codespell]
2+
quiet-level = 2
3+
count =
4+
skip = ./dep,./imgs
5+
ignore-words = ./.github/wordlist.txt
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Help us improve TairHash by reporting a bug
4+
title: '[BUG]'
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
12+
A short description of the bug.
13+
14+
**To reproduce**
15+
16+
Steps to reproduce the behavior and/or a minimal code sample.
17+
18+
**Expected behavior**
19+
20+
A description of what you expected to happen.
21+
22+
**Additional information**
23+
24+
Any additional information that is relevant to the problem.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Crash report
3+
about: Submit a crash report
4+
title: '[CRASH]'
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Crash report**
11+
12+
Paste the complete crash log between the quotes below. Please include a few lines from the log preceding the crash report to provide some context.
13+
14+
```
15+
```
16+
17+
**Additional information**
18+
19+
1. OS distribution and version
20+
2. Steps to reproduce (if any)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
about: Suggest a feature for TairHash
4+
title: '[NEW]'
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**The problem/use-case that the feature addresses**
11+
12+
A description of the problem that the feature will solve, or the use-case with which the feature will be used.
13+
14+
**Description of the feature**
15+
16+
A description of what you want to happen.
17+
18+
**Alternatives you've considered**
19+
20+
Any alternative solutions or features you've considered, including references to existing open and closed feature requests in this repository.
21+
22+
**Additional information**
23+
24+
Any additional information that is relevant to the feature request.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Other
3+
about: Can't find the right issue type? Use this one!
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---

.github/wordlist.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ake
2+
bale
3+
fle
4+
fo
5+
gameboy
6+
mutli
7+
nd
8+
nees
9+
oll
10+
optin
11+
ot
12+
smove
13+
te
14+
tre
15+
cancelability
16+
ist

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
test-ubuntu-with-redis-5:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: clone and make redis
12+
run: |
13+
sudo apt-get install git
14+
git clone https://github.com/redis/redis
15+
cd redis
16+
git checkout 5.0
17+
make REDIS_CFLAGS='-Werror' BUILD_TLS=yes
18+
- name: make tairhash
19+
run: |
20+
mkdir build
21+
cd build
22+
cmake ../
23+
make
24+
- name: test
25+
run: |
26+
sudo apt-get install tcl8.6 tclx
27+
work_path=$(pwd)
28+
module_path=$work_path/lib
29+
sed -e "s#your_path#$module_path#g" tests/tairhash.tcl > redis/tests/unit/type/tairhash.tcl
30+
sed -i 's#unit/type/string#unit/type/tairhash#g' redis/tests/test_helper.tcl
31+
cd redis
32+
./runtest --stack-logging --single unit/type/tairhash
33+
34+
test-ubuntu-with-redis-6:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: clone and make redis
39+
run: |
40+
sudo apt-get install git
41+
git clone https://github.com/redis/redis
42+
cd redis
43+
git checkout 6.0
44+
make REDIS_CFLAGS='-Werror' BUILD_TLS=yes
45+
- name: make tairhash
46+
run: |
47+
mkdir build
48+
cd build
49+
cmake ../
50+
make
51+
- name: test
52+
run: |
53+
sudo apt-get install tcl8.6 tclx
54+
work_path=$(pwd)
55+
module_path=$work_path/lib
56+
sed -e "s#your_path#$module_path#g" tests/tairhash.tcl > redis/tests/unit/type/tairhash.tcl
57+
sed -i 's#unit/type/string#unit/type/tairhash#g' redis/tests/test_helper.tcl
58+
cd redis
59+
./runtest --stack-logging --single unit/type/tairhash
60+
61+
test-ubuntu-with-redis-unstable-sort-mode:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v2
65+
- name: clone and make redis
66+
run: |
67+
sudo apt-get install git
68+
git clone https://github.com/redis/redis
69+
cd redis
70+
git checkout unstable
71+
make REDIS_CFLAGS='-Werror' BUILD_TLS=yes
72+
- name: make tairhash
73+
run: |
74+
mkdir build
75+
cd build
76+
cmake ../ -DSORT_MODE=yes
77+
make
78+
- name: test
79+
run: |
80+
sudo apt-get install tcl8.6 tclx
81+
work_path=$(pwd)
82+
module_path=$work_path/lib
83+
sed -e "s#your_path#$module_path#g" tests/tairhash.tcl > redis/tests/unit/type/tairhash.tcl
84+
sed -i 's#unit/type/string#unit/type/tairhash#g' redis/tests/test_helper.tcl
85+
cd redis
86+
./runtest --stack-logging --single unit/type/tairhash
87+
88+

.github/workflows/spell-check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# A CI action that using codespell to check spell.
2+
# .github/.codespellrc is a config file.
3+
# .github/wordlist.txt is a list of words that will ignore word checks.
4+
# More details please check the following link:
5+
# https://github.com/codespell-project/codespell
6+
name: Spellcheck
7+
8+
on:
9+
push:
10+
pull_request:
11+
12+
jobs:
13+
build:
14+
name: Spellcheck
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
21+
- name: Install prerequisites
22+
run: sudo pip install codespell==2.0.0
23+
24+
- name: Spell check
25+
run: codespell --config=./.github/.codespellrc

tests/tairhash.tcl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ set testmodule [file normalize your_path/tairhash_module.so]
44
start_server {tags {"tairhash"} overrides {bind 0.0.0.0}} {
55
r module load $testmodule
66

7-
proc create_big_tairhash {key iterm} {
7+
proc create_big_tairhash {key item} {
88
r del $key
9-
for {set j 0} {$j < $iterm} {incr j} {
9+
for {set j 0} {$j < $item} {incr j} {
1010
r exhset $key $j $j
1111
}
1212
}
1313

14-
proc create_big_tairhash_with_expire {key iterm expire} {
14+
proc create_big_tairhash_with_expire {key item expire} {
1515
r del $key
16-
for {set j 0} {$j < $iterm} {incr j} {
16+
for {set j 0} {$j < $item} {incr j} {
1717
r exhset $key $j $j ex $expire
1818
}
1919
}

0 commit comments

Comments
 (0)