Skip to content
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

Support PHP 8.0, require PHP 7.3 #482

Merged
merged 2 commits into from Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitattributes
@@ -1,11 +1,11 @@
/.travis export-ignore
/.github export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php_cs export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
Dockerfile export-ignore
Makefile export-ignore
docker-compose.yml export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
File renamed without changes.
229 changes: 229 additions & 0 deletions .github/workflows/integrate.yaml
@@ -0,0 +1,229 @@
name: "Integrate"

on:
pull_request:
push:
branches:
- "master"
schedule:
- cron: '0 3 3 * *'

jobs:
composer-json-lint:
name: "Lint composer.json"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: composer-normalize, composer-require-checker, composer-unused

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"

- name: "Validate composer.json"
run: "composer validate --strict"

- name: "Normalize composer.json"
run: "composer-normalize --dry-run"

- name: "Check composer.json explicit dependencies"
run: "composer-require-checker check --config-file=$(realpath composer-require-checker.json)"

- name: "Check composer.json unused dependencies"
run: "composer-unused"

tests:
name: "Tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"

env:
IMAP_SERVER_NAME: dovecot.travis.dev
IMAP_SERVER_PORT: 993
IMAP_USERNAME: dovecot_travis_testuser
IMAP_PASSWORD: dovecot_travis_testpwd
IMAP_QUOTAROOT_SUPPORTED: true

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Start IMAPd services"
uses: "sh .github/dovecot_install.sh"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: zend.assertions=1

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"

- name: "Run tests"
timeout-minutes: 3
run: "vendor/bin/phpunit --no-coverage --no-logging"

code-coverage:
name: "Code Coverage"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: zend.assertions=1

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"

- name: "Run tests"
timeout-minutes: 3
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"

- name: "Send code coverage report to Codecov.io"
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true

coding-standards:
name: "Coding Standards"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.3"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"

- name: "Check coding standards"
run: "vendor/bin/php-cs-fixer fix --verbose --dry-run --diff"

static-analysis:
name: "Static Analysis"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: cs2pr

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"

- name: "Run static analysis"
run: "vendor/bin/phpstan analyse --no-progress --error-format=checkstyle | cs2pr"
5 changes: 0 additions & 5 deletions .scrutinizer.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .travis/readme-index.php

This file was deleted.

5 changes: 3 additions & 2 deletions Dockerfile
@@ -1,4 +1,4 @@
FROM php:7.2
FROM php:7.3

RUN runtimeDeps=" \
curl \
Expand All @@ -13,4 +13,5 @@ RUN runtimeDeps=" \
&& docker-php-ext-install iconv mbstring imap \
&& rm -r /var/lib/apt/lists/*

RUN curl -sS https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /usr/local/bin/wait-for-it.sh && chmod +x /usr/local/bin/wait-for-it.sh
RUN curl -sS https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /usr/local/bin/wait-for-it.sh \
&& chmod +x /usr/local/bin/wait-for-it.sh