Update 2018_03_18_071831_create_mpesa_bulk_payment_requests_table.php #134
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MPESA API CI | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- features/** | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
laravel-tests: | |
runs-on: ubuntu-latest | |
# Service container Mysql mysql | |
services: | |
# Label used to access the service container | |
mysql: | |
# Docker Hub image (also with version) | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: forge | |
MYSQL_USER: forge | |
SERVICE_NAME: mysql | |
## map the "external" 33306 port with the "internal" 3306 | |
ports: | |
- 33306:3306 | |
# Set health checks to wait until mysql database has started (it takes some seconds to start) | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
strategy: | |
fail-fast: false | |
matrix: | |
operating-system: [ubuntu-latest] | |
php-versions: ["8.0", "7.4", "7.2"] | |
dependency-stability: [prefer-stable] | |
laravel: ["8.*", "7.*", "6.*"] | |
include: | |
- laravel: 8.* | |
testbench: 6.* | |
- laravel: 7.* | |
testbench: 5.* | |
- laravel: 6.* | |
testbench: 4.* | |
exclude: | |
- laravel: 8.* | |
php-versions: 7.2 | |
- laravel: 6.* | |
php-versions: 7.4 | |
- laravel: 6.* | |
php-versions: 8.0 | |
name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install PHP versions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Get Composer Cache Directory 2 | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- uses: actions/cache@v2 | |
id: actions-cache | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Cache PHP dependencies | |
uses: actions/cache@v2 | |
id: vendor-cache | |
with: | |
path: vendor | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} | |
- name: Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Install Laravel Dependencies | |
run: | | |
pwd | |
php --version | |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | |
composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction --no-suggest | |
- name: Run Migrations | |
run: | | |
if ${{ matrix.php-versions }} != '7.2'; then | |
php vendor/bin/testbench migrate | |
fi | |
# Code quality | |
- name: Execute tests (Unit and Feature tests) via PHPUnit | |
# Set environment | |
env: | |
DB_CONNECTION: mysql | |
DB_DATABASE: forge | |
DB_PORT: 33306 | |
DB_USER: forge | |
run: vendor/bin/phpunit --testdox | |
- name: Execute Code Sniffer via phpcs | |
run: | | |
composer require --dev squizlabs/php_codesniffer | |
vendor/bin/phpcs --standard=PSR12 src |