From 56fe8064a185c106b48894ba7e16ccd7574b90f1 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Thu, 10 Dec 2020 21:44:40 -0500 Subject: [PATCH] Added Github Action CI --- .github/workflows/Build.yml | 50 ++++++++++++++++++++++++++++++++++++ phpunit.xml | 4 +++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/Build.yml diff --git a/ .github/workflows/Build.yml b/ .github/workflows/Build.yml new file mode 100644 index 0000000..ef39506 --- /dev/null +++ b/ .github/workflows/Build.yml @@ -0,0 +1,50 @@ +name: Build + +on: + push: + branches: [master, develop] + pull_request: + branches: [master, develop] + +jobs: + PHPUnit: + + strategy: + fail-fast: false + matrix: + php_versions: ['7.1', '7.2', '7.3', '7.4'] + laravel: ['5.8.*'] + + name: PHPUnit Tests - ${{ matrix.php_versions }} - ${{ matrix.laravel }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_versions }} + extensions: mbstring, dom, fileinfo, gd + coverage: xdebug + tools: pecl + - name: Set Laravel version + run: composer require "illuminate/redis:${{ matrix.laravel }}" --no-update + - name: Install Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: Execute tests (Unit and Feature tests) via PHPUnit & MySQL Env + if: ${{ matrix.database == 'mysql' }} + env: + DB_CONNECTION: mysql + DB_HOST: 127.0.0.1 + DB_USER: laravel + DB_PASSWORD: password + DB_DATABASE: laravel + DB_PORT: 3306 + run: vendor/bin/phpunit + - name: Execute tests via PHPUnit + run: vendor/bin/phpunit + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./_meta/coverage.xml + fail_ci_if_error: true diff --git a/phpunit.xml b/phpunit.xml index 4ce3629..2962aa5 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -19,4 +19,8 @@ src/ + + + +