- update local environment and prepare dev deployment #74
Workflow file for this run
This file contains hidden or 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: "Checking app: testing and linting PHP" | |
on: | |
pull_request: | |
branches: [ "main" ] | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths: | |
- '**.php' | |
- 'composer.json' | |
- 'composer.lock' | |
- 'phpunit.xml' | |
- 'env.ci' | |
jobs: | |
test-and-lint-php: | |
name: Test & lint PHP codebase | |
timeout-minutes: 10 | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
services: | |
pgsql: | |
image: postgres:16.3-alpine3.18@sha256:64e18e8fb3e9c9aac89ac590c5dd8306b862478404f76cd9b5f7720d012b4c47 | |
env: | |
POSTGRES_DB: lmt-ci | |
POSTGRES_USER: lmt-ci | |
POSTGRES_PASSWORD: password | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 3s | |
--health-timeout 3s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 # https://github.com/actions/checkout | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Cache dependencies | |
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 # https://github.com/actions/cache | |
with: | |
path: vendor | |
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer-dependencies | |
- name: Setup PHP | |
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # 2.31.1 # https://github.com/shivammathur/setup-php | |
with: | |
php-version: 8.3 | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, intl | |
coverage: none | |
- name: Install Composer dependencies | |
run: composer install --prefer-dist --no-interaction --no-suggest | |
- name: Run PHP linter | |
run: composer cs | |
- name: Execute tests | |
run: php artisan test --env=ci |