CI #1656
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
name: Test on ${{ matrix.platform }} with Python ${{ matrix.python }} | |
runs-on: ${{ matrix.platform }} | |
timeout-minutes: 40 | |
strategy: | |
matrix: | |
platform: ['ubuntu-20.04', 'macos-11'] | |
python: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash -l -eo pipefail {0} | |
steps: | |
- uses: actions/checkout@v3 | |
# Number of commits to fetch. 0 indicates all history for all branches and tags. | |
with: | |
fetch-depth: '' | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: x64 | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip # This path is specific to Ubuntu | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ matrix.platform }}-${{ matrix.python }}-pyproject.toml-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
${{ matrix.platform }}-${{ matrix.python }}-pyproject.toml-${{hashFiles('pyproject.toml')}}} | |
- name: Setup automation | |
run: | | |
git clone --recursive https://github.com/RedisLabsModules/readies.git | |
./readies/bin/getpy3 | |
- name: Install Python dependencies | |
run: | | |
python3 -m pip install poetry | |
python3 -m poetry config virtualenvs.create false | |
python3 -m poetry export --dev --without-hashes -o requirements-${{matrix.platform}}-${{matrix.python}}.txt | |
python3 -m pip install -r requirements-${{matrix.platform}}-${{matrix.python}}.txt | |
- name: Install Redis Server test dependencies | |
run: | | |
./readies/bin/getredis --workdir /tmp/redis -v 7 --keep | |
ln -s /tmp/redis/redis redis | |
redis-server --version | |
- name: Generate test certificates | |
run: | | |
cd redis | |
rm -rf ./tests/unit/tls/ | |
./utils/gen-test-certs.sh | |
- name: Unit Test with pytest | |
timeout-minutes: 30 | |
run: | | |
TLS="$PWD/redis/tests/tls" | |
TLS_CERT=$TLS/redis.crt \ | |
TLS_KEY=$TLS/redis.key \ | |
TLS_CACERT=$TLS/ca.crt \ | |
REDIS_BINARY=`command -v redis-server` \ | |
pytest --ignore=tests/flow --ignore=test_example.py -v | |
- name: Install RLTest | |
run: | | |
python3 -m pip install . | |
- name: Flow Test OSS Single Module | |
run: | | |
cd tests/flow | |
make -C modules | |
CONTAINS_MODULES=1 RLTest --env oss -v --clear-logs --module modules/module1.so | |
- name: Flow Test OSS Multiple Modules --use-slaves | |
run: | | |
cd tests/flow | |
make -C modules | |
CONTAINS_MODULES=1 RLTest --env oss -v --clear-logs \ | |
--module modules/module1.so --module-args '' \ | |
--module modules/module2.so --module-args '' \ | |
--use-slaves | |
- name: Flow Test OSS Multiple Modules --use-aof | |
run: | | |
cd tests/flow | |
make -C modules | |
CONTAINS_MODULES=1 RLTest --env oss -v --clear-logs \ | |
--module modules/module1.so --module-args '' \ | |
--module modules/module2.so --module-args '' \ | |
--use-aof | |
- name: Flow Test OSS Multiple Modules | |
run: | | |
cd tests/flow | |
make -C modules | |
CONTAINS_MODULES=1 RLTest --env oss -v --clear-logs \ | |
--module modules/module1.so --module-args '' \ | |
--module modules/module2.so --module-args '' | |
- name: Flow Test OSS-CLUSTER Modules | |
run: | | |
cd tests/flow | |
make -C modules | |
CONTAINS_MODULES=1 RLTest --env oss-cluster -v --clear-logs \ | |
--module modules/module1.so --module-args '' \ | |
--module modules/module2.so --module-args '' | |
- name: Flow Test OSS TCP | |
run: | | |
cd tests/flow | |
RLTest --env oss -v --clear-logs | |
- name: Flow Test OSS UNIX SOCKETS | |
run: | | |
cd tests/flow | |
RLTest --env oss -v --clear-logs | |
- name: Flow Test OSS TCP SLAVES | |
run: | | |
cd tests/flow | |
RLTest --env oss -v --unix --clear-logs | |
- name: Flow Test OSS-CLUSTER TCP | |
run: | | |
cd tests/flow | |
RLTest --env oss-cluster -v --clear-logs --shards-count 3 | |
- name: Flow Test OSS TCP with TLS | |
run: | | |
TLS="$PWD/redis/tests/tls" | |
cd tests/flow | |
RLTest --env oss -v --clear-logs \ | |
--tls-cert-file $TLS/redis.crt \ | |
--tls-key-file $TLS/redis.key \ | |
--tls-ca-cert-file $TLS/ca.crt \ | |
--tls | |
- name: Flow Test OSS-CLUSTER with TLS | |
run: | | |
TLS="$PWD/redis/tests/tls" | |
cd tests/flow | |
RLTest --env oss-cluster --shards-count 3 -v --clear-logs \ | |
--tls-cert-file $TLS/redis.crt \ | |
--tls-key-file $TLS/redis.key \ | |
--tls-ca-cert-file $TLS/ca.crt \ | |
--tls | |
- name: Flow Test OSS-CLUSTER with SLAVES and TLS | |
run: | | |
TLS="$PWD/redis/tests/tls" | |
cd tests/flow | |
RLTest --env oss-cluster --shards-count 3 --use-slaves -v --clear-logs \ | |
--tls-cert-file $TLS/redis.crt \ | |
--tls-key-file $TLS/redis.key \ | |
--tls-ca-cert-file $TLS/ca.crt \ | |
--tls | |
- name: Generate coverage report | |
if: matrix.python == '3.9' && matrix.platform != 'macos-11' | |
run: | | |
TLS="$PWD/redis/tests/tls" | |
TLS_CERT=$TLS/redis.crt \ | |
TLS_KEY=$TLS/redis.key \ | |
TLS_CACERT=$TLS/ca.crt \ | |
REDIS_BINARY=`command -v redis-server` \ | |
pytest --ignore=tests/flow --ignore=test_example.py --cov-config=.coveragerc --cov-report=xml --cov=RLTest | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
if: matrix.python == '3.9' && matrix.platform != 'macos-11' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true |