Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: phpList REST API Build
on: [push, pull_request]
jobs:
main:
name: phpList Base Dist on PHP ${{ matrix.php-versions }}, with dist ${{ matrix.dependencies }} [Build, Test]
runs-on: ubuntu-20.04
env:
DB_DATABASE: phplist
DB_USERNAME: root
DB_PASSWORD: phplist
BROADCAST_DRIVER: log
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }}
MYSQL_DATABASE: ${{ env.DB_DATABASE }}
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
dependencies: ['latest', 'oldest']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Verify MySQL connection on host
run: mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} -e "SHOW DATABASES"
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# 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 current dependencies from composer.lock
run: composer install
if: ${{ matrix.dependencies }} == "oldest"
- 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
- name: Validating composer.json
run: composer validate --no-check-all --no-check-lock --strict;
- 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 static analysis
run: vendor/bin/phpstan analyse -l 5 src/ tests/;
- name: Running PHPMD
run: vendor/bin/phpmd src/ text vendor/phplist/core/config/PHPMD/rules.xml;
- name: Running PHP_CodeSniffer
run: vendor/bin/phpcs --standard=vendor/phplist/core/config/PhpCodeSniffer/ src/ tests/;
93 changes: 0 additions & 93 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# phpList 4 REST API

[![Build Status](https://travis-ci.com/phpList/rest-api.svg?branch=master)](https://travis-ci.com/phpList/rest-api)
[![Build Status](https://github.com/phpList/rest-api/workflows/phpList%20REST%20API%20Build/badge.svg)](https://github.com/phpList/rest-api/actions)
[![Latest Stable Version](https://poser.pugx.org/phplist/rest-api/v/stable.svg)](https://packagist.org/packages/phpList/rest-api)
[![Total Downloads](https://poser.pugx.org/phplist/rest-api/downloads.svg)](https://packagist.org/packages/phpList/rest-api)
[![Latest Unstable Version](https://poser.pugx.org/phplist/rest-api/v/unstable.svg)](https://packagist.org/packages/phpList/rest-api)
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
"source": "https://github.com/phpList/rest-api"
},
"require": {
"php": "~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0",

"php": "^7.0|^8.0",
"phplist/core": "4.0.x-dev",
"friendsofsymfony/rest-bundle": "^2.3",
"sensio/framework-extra-bundle": "5.1.0"
Expand All @@ -41,7 +40,7 @@
"phpunit/phpunit-mock-objects": "^5.0.6",
"phpunit/dbunit": "^3.0.0",
"guzzlehttp/guzzle": "^6.3.0",
"squizlabs/php_codesniffer": "^3.2.0",
"squizlabs/php_codesniffer": "^3.5.8",
"phpstan/phpstan": "^0.7.0",
"nette/caching": "^2.5.0 || ^3.0.0",
"nikic/php-parser": "^3.1.0",
Expand Down