Skip to content

Commit

Permalink
Upgrade to PHPUnit 10 (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk authored Feb 17, 2023
1 parent 392fa57 commit 732b66f
Show file tree
Hide file tree
Showing 23 changed files with 646 additions and 698 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/BUG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ about: Something is broken?
labels: bug
---

| Q | A
| --- | ---
| ddeboer/imap version | x.y.z
| PHP version | x.y.z
| IMAP provider | Like imap.gmail.com
| Q | A |
|----------------------|---------------------|
| ddeboer/imap version | x.y.z |
| PHP version | x.y.z |
| IMAP provider | Like imap.gmail.com |

#### Summary

Expand Down
17 changes: 11 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
version: 2

updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
versioning-strategy: "widen"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
122 changes: 122 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: "CI"

on:
pull_request:
push:
branches:
- "master"

env:
INI_VALUES: zend.assertions=1,error_reporting=-1

jobs:
composer-json-lint:
name: "Lint composer.json"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "8.1"

steps:
- uses: "actions/checkout@v3"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
tools: composer-normalize,composer-require-checker,composer-unused
- uses: "ramsey/composer-install@v2"

- run: "composer validate --strict"
- run: "composer-normalize --dry-run"
- run: "composer-require-checker check --config-file=$(realpath composer-require-checker.json)"
- run: "composer-unused"

tests:
name: "Tests"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "8.2"
code-coverage:
- "none"
include:
- php-version: "8.1"
code-coverage: "pcov"

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:
- uses: "actions/checkout@v3"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "${{ matrix.code-coverage }}"
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
extensions: "imap"
- uses: "ramsey/composer-install@v2"

- run: "sh .github/dovecot_install.sh"

- name: "Run tests without coverage"
if: ${{ matrix.code-coverage == 'none' }}
timeout-minutes: 3
run: "vendor/bin/phpunit --no-coverage --no-logging"

- name: "Run tests with coverage"
if: ${{ matrix.code-coverage != 'none' }}
timeout-minutes: 3
run: "vendor/bin/phpunit --no-coverage --no-logging --coverage-clover=coverage.xml"

- name: "Send code coverage report to Codecov.io"
if: ${{ matrix.code-coverage != 'none' }}
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:
- "8.1"

steps:
- uses: "actions/checkout@v3"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v2"

- run: "vendor/bin/php-cs-fixer fix --verbose --dry-run --diff"

static-analysis:
name: "Static Analysis"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "8.1"

steps:
- uses: "actions/checkout@v3"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v2"

- run: "vendor/bin/phpstan analyse --no-progress --error-format=github"
197 changes: 0 additions & 197 deletions .github/workflows/integrate.yaml

This file was deleted.

21 changes: 10 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.idea/
tmp/
vendor/
.php-cs-fixer.cache
.phpunit.result.cache
composer.lock
phpunit.xml
wait-for-it
coverage/

.DS_Store
/.idea/
/.phpunit.cache/
/coverage/
/tmp/
/vendor/
/.php-cs-fixer.cache
/.phpunit.result.cache
/composer.lock
/phpunit.xml
/wait-for-it
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_strict' => true,
'php_unit_test_annotation' => true,
'php_unit_test_case_static_method_calls' => true,
'php_unit_test_case_static_method_calls' => false,
'php_unit_test_class_requires_covers' => false,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Stable Version](https://img.shields.io/packagist/v/ddeboer/imap.svg)](https://packagist.org/packages/ddeboer/imap)
[![Downloads](https://img.shields.io/packagist/dt/ddeboer/imap.svg)](https://packagist.org/packages/ddeboer/imap)
[![Integrate](https://github.com/ddeboer/imap/workflows/Integrate/badge.svg?branch=master)](https://github.com/ddeboer/imap/actions)
[![Integrate](https://github.com/ddeboer/imap/workflows/CI/badge.svg)](https://github.com/ddeboer/imap/actions)
[![Code Coverage](https://codecov.io/gh/ddeboer/imap/coverage.svg?branch=master)](https://codecov.io/gh/ddeboer/imap?branch=master)

A PHP IMAP library to read and process e-mails over IMAP protocol, built with robust Object-Oriented architecture.
Expand Down
Loading

0 comments on commit 732b66f

Please sign in to comment.