Skip to content

Commit e15478a

Browse files
zahergcrynobone
authored andcommitted
adding Github actions with two redis instances.
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
1 parent 0180440 commit e15478a

File tree

7 files changed

+240
-226
lines changed

7 files changed

+240
-226
lines changed
File renamed without changes.

.github/confd/redis.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requirepass secret

.github/workflows/laravel-54-tests.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/laravel-tests.yml

Lines changed: 0 additions & 153 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Run tests
2+
3+
on:
4+
push
5+
6+
env:
7+
REDIS_HOST: 127.0.0.1
8+
REDIS_PORT: 6380
9+
10+
jobs:
11+
php-tests:
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
fail-fast: false
16+
max-parallel: 15
17+
matrix:
18+
php: [7.4, 7.3, 7.2, 7.1]
19+
laravel: [6.*, 5.8.*, 5.7.*, 5.6.*, 5.5.*]
20+
dependency-version: [prefer-stable]
21+
os: [ubuntu-latest]
22+
redis-versions: [5-alpine]
23+
exclude:
24+
- laravel: 6.*
25+
php: 7.1
26+
- laravel: 5.7.*
27+
php: 7.4
28+
- laravel: 5.6.*
29+
php: 7.4
30+
- laravel: 5.5.*
31+
php: 7.4
32+
33+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - Insecure
34+
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v1
38+
39+
- name: Setup PHP
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: ${{ matrix.php }}
43+
ini-values: variables_order="EGPCS"
44+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, redis
45+
coverage: none
46+
47+
- name: Cache dependencies
48+
uses: actions/cache@v2
49+
with:
50+
path: ~/.composer/cache/files
51+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
52+
53+
- name: Run redis without a password
54+
run: |
55+
docker run --rm --name redis -p $REDIS_PORT:6379 -d redis:${{ matrix.redis-versions }}
56+
57+
- name: Check which docker images is running
58+
run: docker ps -a
59+
60+
- name: Install dependencies
61+
run: |
62+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
63+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
64+
65+
- name: Execute tests
66+
# we need to split the tests into two groups one for secure and one for insecure redis
67+
# run: vendor/bin/phpunit --exclude-group=redis-secure
68+
run: vendor/bin/phpunit --testdox
69+
70+
71+
redis-with-password:
72+
runs-on: ${{ matrix.os }}
73+
74+
env:
75+
REDIS_PASS: secret
76+
REDIS_SECURE: true
77+
78+
strategy:
79+
max-parallel: 15
80+
fail-fast: false
81+
matrix:
82+
php: [7.4, 7.3, 7.2, 7.1]
83+
laravel: [6.*, 5.8.*, 5.7.*, 5.6.*, 5.5.*]
84+
dependency-version: [prefer-stable]
85+
os: [ubuntu-latest]
86+
redis-versions: [5-alpine]
87+
exclude:
88+
- laravel: 6.*
89+
php: 7.1
90+
- laravel: 5.7.*
91+
php: 7.4
92+
- laravel: 5.6.*
93+
php: 7.4
94+
- laravel: 5.5.*
95+
php: 7.4
96+
97+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - Secure
98+
99+
steps:
100+
- name: Checkout code
101+
uses: actions/checkout@v1
102+
103+
- name: Setup PHP
104+
uses: shivammathur/setup-php@v2
105+
with:
106+
php-version: ${{ matrix.php }}
107+
ini-values: variables_order="EGPCS"
108+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, redis
109+
coverage: none
110+
111+
- name: Cache dependencies
112+
uses: actions/cache@v2
113+
with:
114+
path: ~/.composer/cache/files
115+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
116+
117+
- name: Run redis with a password
118+
run: |
119+
docker run --rm --name redis -p $REDIS_PORT:6379 -d redis:${{ matrix.redis-versions }} redis-server --requirepass "secret" --port 6379
120+
121+
- name: Install dependencies
122+
run: |
123+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
124+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
125+
126+
- name: Check that redis is still alive
127+
run: docker ps -a
128+
129+
- name: Execute tests
130+
# we need to split the tests into two groups one for secure and one for insecure redis
131+
# run: vendor/bin/phpunit --exclude-group=redis-insecure
132+
run: vendor/bin/phpunit --testdox

0 commit comments

Comments
 (0)