diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..5ac89e8 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,29 @@ +name: PHP Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['5.3', '7.0', '7.1', '7.2', '7.3', '7.4'] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + - name: Validate composer.json and composer.lock + run: composer validate + - name: Install dependencies + run: composer install --prefer-dist --no-progress + - name: Run PHPCS + run: composer run-script lint + - name: Run PHPUnit + run: composer run-script test diff --git a/composer.json b/composer.json index 7870aa4..a92cdb0 100644 --- a/composer.json +++ b/composer.json @@ -31,5 +31,9 @@ "suggest": { "chadicus/slim-oauth2-routes": "Offers standard OAuth2 routes for slim applications", "chadicus/slim-oauth2-middleware": "Adds OAuth2 middleware for API requests." + }, + "scripts": { + "lint": "vendor/bin/phpcs", + "test": "vendor/bin/phpunit" } }