Fix serverless gha #22
Workflow file for this run
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: Pull Request | |
on: [pull_request] | |
env: | |
PROJECT: "maurobaptista.com" | |
STAGE: "production" | |
AWS_REGION: "us-east-1" | |
PHP_VERSION: "8.1" | |
COMPOSER_VERSION: "v2" | |
jobs: | |
code-check: | |
name: "Run Code Check" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
tools: composer:${{ env.COMPOSER_VERSION }} | |
coverage: none | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.composer/cache/files | |
key: dependencies-composer-${{ hashFiles('composer.json') }} | |
- name: Install Dependencies | |
run: composer install --no-ansi --no-interaction --prefer-dist --optimize-autoloader | |
- name: Code Sniffer | |
run: composer phpcs:check | |
- name: Mess Detector | |
run: composer phpmd:check | |
- name: Mess Detector | |
run: composer phpcpd:check | |
tests: | |
name: Run Unit Tests | |
runs-on: ubuntu-latest | |
needs: [ code-check ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP with Xdebug | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
tools: composer:${{ env.COMPOSER_VERSION }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | |
coverage: xdebug | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.composer/cache/files | |
key: dependencies-composer-${{ hashFiles('composer.lock') }} | |
- name: Npm install & build | |
run: | | |
npm install | |
npm run build | |
- name: Install PHP Dependencies | |
run: composer install --no-ansi --no-interaction --prefer-dist --optimize-autoloader | |
- name: Copy .env | |
run: cp .env.example .env | |
- name: Generate key | |
run: php artisan key:generate | |
- name: Clear Config | |
run: php artisan config:clear | |
- name: Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Execute tests | |
run: php artisan test --configuration=phpunit-ci.xml |