Skip to content

Commit

Permalink
Add ci (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyang8094 authored Nov 19, 2021
1 parent 49a951f commit 0bf5dcb
Show file tree
Hide file tree
Showing 9 changed files with 214 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
quiet-level = 2
count =
skip = ./dep,./imgs
ignore-words = ./.github/wordlist.txt
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug report
about: Help us improve TairHash by reporting a bug
title: '[BUG]'
labels: ''
assignees: ''

---

**Describe the bug**

A short description of the bug.

**To reproduce**

Steps to reproduce the behavior and/or a minimal code sample.

**Expected behavior**

A description of what you expected to happen.

**Additional information**

Any additional information that is relevant to the problem.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/crash_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Crash report
about: Submit a crash report
title: '[CRASH]'
labels: ''
assignees: ''

---

**Crash report**

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.

```
```

**Additional information**

1. OS distribution and version
2. Steps to reproduce (if any)
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest a feature for TairHash
title: '[NEW]'
labels: ''
assignees: ''

---

**The problem/use-case that the feature addresses**

A description of the problem that the feature will solve, or the use-case with which the feature will be used.

**Description of the feature**

A description of what you want to happen.

**Alternatives you've considered**

Any alternative solutions or features you've considered, including references to existing open and closed feature requests in this repository.

**Additional information**

Any additional information that is relevant to the feature request.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/other_stuff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Other
about: Can't find the right issue type? Use this one!
title: ''
labels: ''
assignees: ''

---
16 changes: 16 additions & 0 deletions .github/wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ake
bale
fle
fo
gameboy
mutli
nd
nees
oll
optin
ot
smove
te
tre
cancelability
ist
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI

on: [push, pull_request]

jobs:

test-ubuntu-with-redis-5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: clone and make redis
run: |
sudo apt-get install git
git clone https://github.com/redis/redis
cd redis
git checkout 5.0
make REDIS_CFLAGS='-Werror' BUILD_TLS=yes
- name: make tairhash
run: |
mkdir build
cd build
cmake ../
make
- name: test
run: |
sudo apt-get install tcl8.6 tclx
work_path=$(pwd)
module_path=$work_path/lib
sed -e "s#your_path#$module_path#g" tests/tairhash.tcl > redis/tests/unit/type/tairhash.tcl
sed -i 's#unit/type/string#unit/type/tairhash#g' redis/tests/test_helper.tcl
cd redis
./runtest --stack-logging --single unit/type/tairhash
test-ubuntu-with-redis-6:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: clone and make redis
run: |
sudo apt-get install git
git clone https://github.com/redis/redis
cd redis
git checkout 6.0
make REDIS_CFLAGS='-Werror' BUILD_TLS=yes
- name: make tairhash
run: |
mkdir build
cd build
cmake ../
make
- name: test
run: |
sudo apt-get install tcl8.6 tclx
work_path=$(pwd)
module_path=$work_path/lib
sed -e "s#your_path#$module_path#g" tests/tairhash.tcl > redis/tests/unit/type/tairhash.tcl
sed -i 's#unit/type/string#unit/type/tairhash#g' redis/tests/test_helper.tcl
cd redis
./runtest --stack-logging --single unit/type/tairhash
test-ubuntu-with-redis-unstable-sort-mode:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: clone and make redis
run: |
sudo apt-get install git
git clone https://github.com/redis/redis
cd redis
git checkout unstable
make REDIS_CFLAGS='-Werror' BUILD_TLS=yes
- name: make tairhash
run: |
mkdir build
cd build
cmake ../ -DSORT_MODE=yes
make
- name: test
run: |
sudo apt-get install tcl8.6 tclx
work_path=$(pwd)
module_path=$work_path/lib
sed -e "s#your_path#$module_path#g" tests/tairhash.tcl > redis/tests/unit/type/tairhash.tcl
sed -i 's#unit/type/string#unit/type/tairhash#g' redis/tests/test_helper.tcl
cd redis
./runtest --stack-logging --single unit/type/tairhash
25 changes: 25 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# A CI action that using codespell to check spell.
# .github/.codespellrc is a config file.
# .github/wordlist.txt is a list of words that will ignore word checks.
# More details please check the following link:
# https://github.com/codespell-project/codespell
name: Spellcheck

on:
push:
pull_request:

jobs:
build:
name: Spellcheck
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install prerequisites
run: sudo pip install codespell==2.0.0

- name: Spell check
run: codespell --config=./.github/.codespellrc
8 changes: 4 additions & 4 deletions tests/tairhash.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ set testmodule [file normalize your_path/tairhash_module.so]
start_server {tags {"tairhash"} overrides {bind 0.0.0.0}} {
r module load $testmodule

proc create_big_tairhash {key iterm} {
proc create_big_tairhash {key item} {
r del $key
for {set j 0} {$j < $iterm} {incr j} {
for {set j 0} {$j < $item} {incr j} {
r exhset $key $j $j
}
}

proc create_big_tairhash_with_expire {key iterm expire} {
proc create_big_tairhash_with_expire {key item expire} {
r del $key
for {set j 0} {$j < $iterm} {incr j} {
for {set j 0} {$j < $item} {incr j} {
r exhset $key $j $j ex $expire
}
}
Expand Down

0 comments on commit 0bf5dcb

Please sign in to comment.