Skip to content

Commit

Permalink
Dropped php 7.0 and 7.1, updated package, ignored build errors for ph…
Browse files Browse the repository at this point in the history
…p8.0 (#133)

* added github workflow(action) for build and test ci tasks

Signed-off-by: fenn-cs <[email protected]>

* updated php_codesniffer dep

Signed-off-by: fenn-cs <[email protected]>

* updated core dep, dropped php7.0 and php7.1

Signed-off-by: fenn-cs <[email protected]>

* removed php7.0 and 7.1 from workflows, added database requirements

Signed-off-by: fenn-cs <[email protected]>

* updated friendsofsymfony/rest-bundle

Signed-off-by: fenn-cs <[email protected]>

* excluded lowest dependencies from builds

Signed-off-by: fenn-cs <[email protected]>

* ignored build errors in php8.0`

Signed-off-by: fenn-cs <[email protected]>
  • Loading branch information
nfebe authored Mar 6, 2021
1 parent 70d45ad commit 8937e1e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
35 changes: 24 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
dependencies: ['latest', 'oldest']
php-versions: ['7.2', '7.3', '7.4', '8.0']
# dependencies: ['latest', 'oldest'] # Only latest/upwards dependencies supported currently.
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -48,25 +48,38 @@ jobs:
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install the lowest dependencies
run: composer update --with-dependencies --prefer-stable --prefer-dist --prefer-lowest
if: ${{ matrix.dependencies }} == "latest"
# - name: Install the lowest dependencies
# run: composer update --with-dependencies --prefer-stable --prefer-dist --prefer-lowest
# if: ${{ matrix.dependencies }} == "latest"
- name: Install current dependencies from composer.lock
run: composer install
if: ${{ matrix.dependencies }} == "oldest"
continue-on-error: ${{matrix.php-versions == '8.0' }} # Temporal until full support for php8 === [temp-php8]
- name: Set up database schema
run: mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} ${{ env.DB_DATABASE }} < vendor/phplist/core/resources/Database/Schema.sql
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Validating composer.json
run: composer validate --no-check-all --no-check-lock --strict;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Linting all php files
run: find src/ tests/ public/ -name ''*.php'' -print0 | xargs -0 -n 1 -P 4 php -l; php -l;
- name: Run integration tests with phpunit
run: vendor/bin/phpunit tests/Integration/
- name: Running the system tests
run: vendor/bin/phpunit tests/Integration/;
- name: Running unit tests
run: vendor/bin/phpunit tests/Unit/;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running the integration tests
run: |
export PHPLIST_DATABASE_NAME=${{ env.DB_DATABASE }}
export PHPLIST_DATABASE_USER=${{ env.DB_USERNAME }}
export PHPLIST_DATABASE_PASSWORD=${{ env.DB_PASSWORD }}
export PHPLIST_DATABASE_PORT=${{ job.services.mysql.ports['3306'] }}
export PHPLIST_DATABASE_HOST=127.0.0.1
vendor/bin/phpunit tests/Integration/
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running static analysis
run: vendor/bin/phpstan analyse -l 5 src/ tests/;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running PHPMD
run: vendor/bin/phpmd src/ text vendor/phplist/core/config/PHPMD/rules.xml;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running PHP_CodeSniffer
run: vendor/bin/phpcs --standard=vendor/phplist/core/config/PhpCodeSniffer/ src/ tests/;
run: vendor/bin/phpcs --standard=vendor/phplist/core/config/PhpCodeSniffer/ src/ tests/;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
"source": "https://github.com/phpList/rest-api"
},
"require": {
"php": "^7.0|^8.0",
"phplist/core": "4.0.x-dev",
"friendsofsymfony/rest-bundle": "^2.3",
"php": "^7.2|^8.0",
"phplist/core": "^v4.0.0-alpha5",
"friendsofsymfony/rest-bundle": "^2.8.6",
"sensio/framework-extra-bundle": "5.1.0"
},
"require-dev": {
"phpunit/phpunit": "^6.5.6",
"phpunit/phpunit": "^6.5.14",
"phpunit/phpunit-mock-objects": "^5.0.6",
"phpunit/dbunit": "^3.0.0",
"guzzlehttp/guzzle": "^6.3.0",
"phpunit/dbunit": "^3.0.3",
"guzzlehttp/guzzle": "^6.5.5",
"squizlabs/php_codesniffer": "^3.5.8",
"phpstan/phpstan": "^0.7.0",
"nette/caching": "^2.5.0 || ^3.0.0",
"nette/caching": "^3.1.0",
"nikic/php-parser": "^3.1.0",
"phpmd/phpmd": "^2.6.0"
"phpmd/phpmd": "^2.9.1"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 8937e1e

Please sign in to comment.