Skip to content

[] - Probar Pull Request Action #10

[] - Probar Pull Request Action

[] - Probar Pull Request Action #10

Workflow file for this run

name: Pull Request Action
on:
pull_request:
branches: ["main"]
jobs:
Prepare_environment:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Cache vendor
uses: actions/cache@v3
id: composer-cache
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}-${{ hashFiles('composer.json') }}
- name: Install composer dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-ansi --no-interaction --no-suggest --no-progress --prefer-dist
- name: Copy .env
run: cp .env.example .env
- name: Composer install
run: composer install --no-interaction --prefer-dist
Run_linters:
runs-on: ubuntu-latest
needs: Prepare_environment
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Copy .env
run: cp .env.example .env
- name: Cache composer
uses: actions/cache@v3
id: composer-cache
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}-${{ hashFiles('composer.json') }}
- name: Install composer dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: New linters validation with grump
run: git diff origin/$GITHUB_BASE_REF --name-only --diff-filter=ACMR | php ./vendor/bin/grumphp run -c grumphpPR.yml
Run_unit_tests:
runs-on: ubuntu-latest
needs: Prepare_environment
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Copy .env
run: cp .env.example .env
- name: Cache composer
uses: actions/cache@v3
id: composer-cache
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}-${{ hashFiles('composer.json') }}
- name: Install composer dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Run Tests
run: vendor/bin/phpunit --configuration phpunit_unit.xml
Run_integration_tests:
runs-on: ubuntu-latest
needs: Prepare_environment
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Copy .env
run: cp .env.example .env
- name: Cache composer
uses: actions/cache@v3
id: composer-cache
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}-${{ hashFiles('composer.json') }}
- name: Install composer dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Run Tests
run: vendor/bin/phpunit --configuration phpunit_integration.xml