Skip to content

Update GitHub actions #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 44 additions & 45 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,50 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.2', '7.3', '7.4', '8.0']
rts-version: ['1.4.10']
services:
redis:
image: redislabs/redistimeseries:${{ matrix.rts-version }}
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
--health-start-period=20s
php-version: ['7.4', '8.0', '8.1', '8.2']
rts-version: ['1.4.13', '1.6.19', '1.8.12']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
- uses: actions/checkout@v3
- uses: adambirds/[email protected]
with:
php-version: ${{ matrix.php-version }}
extensions: redis
coverage: xdebug
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run tests
run: vendor/bin/phpunit --coverage-text
env:
REDIS_HOST: localhost
REDIS_TIMESERIES_VERSION: ${{ matrix.rts-version }}
- name: Run psalm
run: vendor/bin/psalm
- name: Export coverage
uses: paambaati/[email protected]
if: ${{ matrix.php-version == '7.4' && matrix.rts-version == '1.4.10' }}
down-flags: "--volumes"
test-container: php-rts-php
test-command: "./run_ci.sh"
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageLocations: clover.xml:clover
PHP_VERSION: ${{ matrix.php-version }}
RTS_VERSION: ${{ matrix.rts-version }}

# - name: Checkout
# uses: actions/checkout@v2
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php-version }}
# extensions: redis
# coverage: xdebug
# - name: Get composer cache directory
# id: composer-cache
# run: echo "::set-output name=dir::$(composer config cache-files-dir)"
# - name: Cache composer dependencies
# uses: actions/cache@v2
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: ${{ runner.os }}-composer-
# - name: Install dependencies
# run: |
# composer install --no-progress --prefer-dist --optimize-autoloader
# - name: Run tests
# run: vendor/bin/phpunit --coverage-text
# env:
# REDIS_HOST: localhost
# REDIS_TIMESERIES_VERSION: ${{ matrix.rts-version }}
# - name: Run psalm
# run: vendor/bin/psalm
# - name: Export coverage
# uses: paambaati/[email protected]
# if: ${{ matrix.php-version == '7.4' && matrix.rts-version == '1.4.10' }}
# env:
# CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
# with:
# coverageLocations: clover.xml:clover
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM php:7.4-cli
ARG PHP_VERSION=7.4
FROM php:${PHP_VERSION}-cli

ARG DEBIAN_FRONTEND=noninteractive
ARG COMPOSER_VERSION=2.5.8
ARG XDEBUG_PACKAGE=xdebug-3.1.5

WORKDIR /app

ENV XDEBUG_MODE=coverage
Expand All @@ -9,10 +14,10 @@ RUN apt-get -y upgrade && \
apt-get update && \
apt-get install -yqq zip git wget

RUN pecl install redis && \
pecl install xdebug && \
docker-php-ext-enable redis xdebug
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions igbinary redis xdebug

RUN wget https://github.com/composer/composer/releases/download/2.0.12/composer.phar -q && \
RUN wget https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar -q && \
mv composer.phar /usr/bin/composer && \
chmod +x /usr/bin/composer
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
"ext-redis": "*"
},
"require-dev": {
"phpunit/phpunit": "^8.3",
"vimeo/psalm": "^4.7"
"phpunit/phpunit": "^9.6",
"vimeo/psalm": "^5.13"
},
"config": {
"platform": {
"php": "7.4"
}
}
}
Loading