diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..eee61ef --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: PHP Composer + +on: [push, pull_request] + +jobs: + build: + name: Build for ${{ matrix.php-version }} + runs-on: ubuntu-latest + strategy: + matrix: + php-version: [7.1, 7.2, 7.3, 7.4, 8.0] + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Update phpunit + if: startsWith(matrix.php, '7.1') + run: | + composer update --prefer-lowest + + - name: Run test suite + run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index adc6166..0fb3451 100644 --- a/composer.json +++ b/composer.json @@ -3,12 +3,12 @@ "description": "Configuration wrapper for redis-sentinel or plain redis", "type": "library", "require": { - "php": "^7.1", + "php": ">=7.1 | >=8.0", "jamescauwelier/psredis": "^1.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.14", - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": "^7.0 | ^9.0" }, "license": "MIT", "authors": [