Skip to content

Commit 3296606

Browse files
committed
build
1 parent 8a389fc commit 3296606

File tree

2 files changed

+18
-34
lines changed

2 files changed

+18
-34
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,9 @@ jobs:
2525
- name: Checkout
2626
uses: actions/checkout@v2
2727

28-
- name: Start Redis v8
29-
uses: superchargejs/[email protected]
30-
with:
31-
redis-version: 8
32-
33-
- name: Start Redis Sentinel
34-
uses: superchargejs/[email protected]
35-
with:
36-
redis-image: bitnami/redis-sentinel:latest
37-
38-
- name: Install PHP with extensions
39-
uses: shivammathur/setup-php@v2
40-
with:
41-
php-version: ${{ matrix.php }}
42-
extensions: curl, intl, redis
43-
ini-values: date.timezone='UTC'
44-
tools: composer:v2, pecl
45-
46-
- name: Get Composer cache directory
47-
id: composer-cache
48-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
49-
50-
- name: Cache Composer dependencies
51-
uses: actions/cache@v4
52-
with:
53-
path: ${{ steps.composer-cache.outputs.dir }}
54-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
55-
restore-keys: ${{ runner.os }}-composer-
56-
57-
- name: Install dependencies with Composer
58-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
59-
60-
- name: Run Redis tests with PhpUnit
61-
run: vendor/bin/phpunit --coverage-clover=coverage.clover
28+
- name: PHP tests for PHP ${{ matrix.php }}
29+
run: |
30+
make build v=${{ matrix.php }}
31+
make test v=${{ matrix.php }}
32+
33+

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,15 @@ clean:
3535
docker rm $(shell cat tests/dockerids/redis)
3636
rm tests/dockerids/redis
3737

38+
test-sentinel:
39+
make build
40+
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml build --pull yii2-redis-php
41+
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml run yii2-redis-php vendor/bin/phpunit --coverage-clover=coverage.clover
42+
make down
43+
44+
build: ## Build an image from a docker-compose file. Params: {{ v=8.1 }}. Default latest PHP 8.1
45+
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml up -d --build
46+
47+
down: ## Stop and remove containers, networks
48+
docker-compose -f tests/docker/docker-compose.yml down
49+

0 commit comments

Comments
 (0)