Skip to content

Commit 8ab70c9

Browse files
committed
setup Redis for tests
1 parent f9dd6e3 commit 8ab70c9

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

Diff for: .github/workflows/plugin.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ jobs:
3737
ports:
3838
- 3306/tcp
3939
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
40+
redis:
41+
image: redis
42+
ports:
43+
- 6379/tcp
44+
options: >-
45+
--health-cmd "redis-cli ping"
46+
--health-interval 10s
47+
--health-timeout 5s
48+
--health-retries 5
4049
4150
strategy:
4251
matrix:
@@ -53,7 +62,7 @@ jobs:
5362
- name: Install dependencies
5463
run: |
5564
sudo apt-get update -y \
56-
&& sudo apt-get update -y && sudo apt-get install -y librrd-dev rrdtool
65+
&& sudo apt-get update -y && sudo apt-get install -y librrd-dev rrdtool redis-server
5766
python -m pip install --upgrade pip
5867
pip install -r requirements.txt
5968
pip install -r test-requirements.txt
@@ -63,6 +72,11 @@ jobs:
6372
python setup.py develop
6473
cd ../modoboa-webmail
6574
python setup.py develop
75+
echo "Testing redis connection"
76+
redis-cli -h $REDIS_HOST -p $REDIS_PORT ping
77+
env:
78+
REDIS_HOST: localhost
79+
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
6680
- name: Install postgres requirements
6781
if: ${{ matrix.database == 'postgres' }}
6882
run: |
@@ -84,6 +98,8 @@ jobs:
8498
MYSQL_HOST: 127.0.0.1
8599
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} # get randomly assigned published port
86100
MYSQL_USER: root
101+
REDIS_HOST: localhost
102+
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
87103

88104
- name: Test with pytest and coverage
89105
if: ${{ matrix.python-version == '3.10' && matrix.database == 'postgres' }}
@@ -99,6 +115,8 @@ jobs:
99115
MYSQL_HOST: 127.0.0.1
100116
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} # get randomly assigned published port
101117
MYSQL_USER: root
118+
REDIS_HOST: localhost
119+
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
102120
- name: Upload coverage result
103121
if: ${{ matrix.python-version == '3.10' && matrix.database == 'postgres' }}
104122
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)