diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5956150..2fca57d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,10 +4,20 @@ on: [push] jobs: build: + strategy: + matrix: + version: ['7.4', '8.0', '8.1', '8.2'] + env: + PHP_VERSION: ${{ matrix.version }} runs-on: ubuntu-latest steps: + - name: Set Swap Space + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 10 + - uses: actions/checkout@v2 - name: Generate ssh keygen for the containers interaction @@ -33,6 +43,7 @@ jobs: - name: Check with php-cs-fixer run: docker-compose run --rm --no-deps dplr vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --show-progress=none -v + if: ${{ matrix.version == '7.4' }} - name: Run tests run: docker-compose run --rm --no-deps dplr vendor/bin/phpunit diff --git a/composer.json b/composer.json index 5b34a92..4ff3318 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": ">=7.3", + "php": ">=7.4 || ^8", "ext-json": "*" }, "autoload": { diff --git a/docker-compose.yml b/docker-compose.yml index ae1ffbe..e89361c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,10 @@ version: "3.1" services: dplr: - build: docker/images/dplr + build: + context: ./docker/images/dplr + args: + PHP_VERSION: ${PHP_VERSION:-7.4} working_dir: /var/www/dplr volumes: - ./:/var/www/dplr diff --git a/docker/images/dplr/Dockerfile b/docker/images/dplr/Dockerfile index 6c2bf7b..0f3210f 100644 --- a/docker/images/dplr/Dockerfile +++ b/docker/images/dplr/Dockerfile @@ -1,3 +1,4 @@ +ARG PHP_VERSION=7.4 FROM golang:alpine AS gossha RUN apk --update --no-cache add --virtual build-dependencies \ @@ -5,7 +6,7 @@ RUN apk --update --no-cache add --virtual build-dependencies \ && go install github.com/YuriyNasretdinov/GoSSHa@latest \ && apk update && apk del build-dependencies -FROM php:7.3-alpine +FROM php:${PHP_VERSION}-alpine COPY --from=gossha /go/bin/GoSSHa /usr/local/bin/GoSSHa