redict/.github/workflows/ci.yml

64 lines
1.5 KiB
YAML
Raw Normal View History

2019-10-20 03:04:25 -04:00
name: CI
on: [push, pull_request]
jobs:
2020-05-24 01:00:12 -04:00
test-ubuntu-latest:
runs-on: ubuntu-latest
2019-10-20 03:04:25 -04:00
steps:
- uses: actions/checkout@v2
2019-10-20 03:04:25 -04:00
- name: make
# Fail build if there are warnings
# build with TLS just for compilation coverage
run: make REDIS_CFLAGS='-Werror' BUILD_TLS=yes
2019-10-20 03:04:25 -04:00
- name: test
run: |
sudo apt-get install tcl8.6 tclx
Improve test suite to handle external servers better. (#9033) This commit revives the improves the ability to run the test suite against external servers, instead of launching and managing `redis-server` processes as part of the test fixture. This capability existed in the past, using the `--host` and `--port` options. However, it was quite limited and mostly useful when running a specific tests. Attempting to run larger chunks of the test suite experienced many issues: * Many tests depend on being able to start and control `redis-server` themselves, and there's no clear distinction between external server compatible and other tests. * Cluster mode is not supported (resulting with `CROSSSLOT` errors). This PR cleans up many things and makes it possible to run the entire test suite against an external server. It also provides more fine grained controls to handle cases where the external server supports a subset of the Redis commands, limited number of databases, cluster mode, etc. The tests directory now contains a `README.md` file that describes how this works. This commit also includes additional cleanups and fixes: * Tests can now be tagged. * Tag-based selection is now unified across `start_server`, `tags` and `test`. * More information is provided about skipped or ignored tests. * Repeated patterns in tests have been extracted to common procedures, both at a global level and on a per-test file basis. * Cleaned up some cases where test setup was based on a previous test executing (a major anti-pattern that repeats itself in many places). * Cleaned up some cases where test teardown was not part of a test (in the future we should have dedicated teardown code that executes even when tests fail). * Fixed some tests that were flaky running on external servers.
2021-06-09 08:13:24 -04:00
./runtest --verbose --tags -slow
- name: module api test
run: ./runtest-moduleapi --verbose
build-debian-old:
runs-on: ubuntu-latest
container: debian:oldoldstable
steps:
- uses: actions/checkout@v2
- name: make
run: |
apt-get update && apt-get install -y build-essential
make REDIS_CFLAGS='-Werror'
2019-10-20 03:04:25 -04:00
build-macos-latest:
runs-on: macos-latest
2019-10-20 03:04:25 -04:00
steps:
- uses: actions/checkout@v2
2019-10-20 03:04:25 -04:00
- name: make
run: make REDIS_CFLAGS='-Werror'
2020-05-24 01:00:12 -04:00
2020-07-10 09:05:29 -04:00
build-32bit:
2020-05-24 01:00:12 -04:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2020-05-24 01:00:12 -04:00
- name: make
run: |
sudo apt-get update && sudo apt-get install libc6-dev-i386
make REDIS_CFLAGS='-Werror' 32bit
2020-05-24 01:00:12 -04:00
build-libc-malloc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2020-05-24 01:00:12 -04:00
- name: make
run: make REDIS_CFLAGS='-Werror' MALLOC=libc
2020-05-24 01:00:12 -04:00
Implement redisAtomic to replace _Atomic C11 builtin (#7707) Redis 6.0 introduces I/O threads, it is so cool and efficient, we use C11 _Atomic to establish inter-thread synchronization without mutex. But the compiler that must supports C11 _Atomic can compile redis code, that brings a lot of inconvenience since some common platforms can't support by default such as CentOS7, so we want to implement redis atomic type to make it more portable. We have implemented our atomic variable for redis that only has 'relaxed' operations in src/atomicvar.h, so we implement some operations with 'sequentially-consistent', just like the default behavior of C11 _Atomic that can establish inter-thread synchronization. And we replace all uses of C11 _Atomic with redis atomic variable. Our implementation of redis atomic variable uses C11 _Atomic, __atomic or __sync macros if available, it supports most common platforms, and we will detect automatically which feature we use. In Makefile we use a dummy file to detect if the compiler supports C11 _Atomic. Now for gcc, we can compile redis code theoretically if your gcc version is not less than 4.1.2(starts to support __sync_xxx operations). Otherwise, we remove use mutex fallback to implement redis atomic variable for performance and test. You will get compiling errors if your compiler doesn't support all features of above. For cover redis atomic variable tests, we add other CI jobs that build redis on CentOS6 and CentOS7 and workflow daily jobs that run the tests on them. For them, we just install gcc by default in order to cover different compiler versions, gcc is 4.4.7 by default installation on CentOS6 and 4.8.5 on CentOS7. We restore the feature that we can test redis with Helgrind to find data race errors. But you need install Valgrind in the default path configuration firstly before running your tests, since we use macros in helgrind.h to tell Helgrind inter-thread happens-before relationship explicitly for avoiding false positives. Please open an issue on github if you find data race errors relate to this commit. Unrelated: - Fix redefinition of typedef 'RedisModuleUserChangedFunc' For some old version compilers, they will report errors or warnings, if we re-define function type.
2020-09-17 09:01:45 -04:00
build-centos7-jemalloc:
runs-on: ubuntu-latest
container: centos:7
steps:
- uses: actions/checkout@v2
- name: make
run: |
yum -y install gcc make
make REDIS_CFLAGS='-Werror'