Skip to content

Fix/redis no connection issue #520

Fix/redis no connection issue

Fix/redis no connection issue #520

Workflow file for this run

name: checks format & runs tests
on:
push:
branches:
- 'main'
pull_request:
release:
types:
- published
workflow_dispatch:
jobs:
code_checks:
name: Check code style and quality
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Run Erlang 23 tasks in Docker (code checks)
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ubuntu:20.04 bash -c "
apt update &&
DEBIAN_FRONTEND=noninteractive apt install -y curl git build-essential libssl-dev autoconf libncurses5-dev libwxgtk3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk libsnappy-dev &&
curl -O https://erlang.org/download/otp_src_23.3.tar.gz &&
tar -xzf otp_src_23.3.tar.gz &&
cd otp_src_23.3 &&
./configure &&
make -j$(nproc) &&
make install &&
cd /workspace &&
./rebar3 fmt -c &&
./rebar3 dialyzer
"
coverage:
runs-on: ubuntu-22.04
needs: code_checks
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: vmq_test_user
POSTGRES_PASSWORD: vmq_test_password
POSTGRES_DB: vmq_test_database
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached
ports:
- 11211:11211
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redissentinel:
image: bitnami/redis-sentinel
ports:
- 26379:26379
options: >-
--health-cmd "redis-cli -p 26379 ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Run Erlang 23 tasks in Docker (test & coverage)
run: |
docker run --rm \
--network host \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
ubuntu:20.04 bash -c "
apt update &&
DEBIAN_FRONTEND=noninteractive apt install -y curl git build-essential libssl-dev autoconf libncurses5-dev libwxgtk3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk libsnappy-dev pcregrep &&
curl -O https://erlang.org/download/otp_src_23.3.tar.gz &&
tar -xzf otp_src_23.3.tar.gz &&
cd otp_src_23.3 &&
./configure &&
make -j$(nproc) &&
make install &&
cd /workspace &&
make rel &&
make db-setup &&
sh ./run-tests-with-retry.sh .
"