Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: "Copilot Setup Steps"

on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
timeout-minutes: 30

permissions:
contents: read

services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: testbench
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -ppassword"
--health-interval=10s
--health-timeout=5s
--health-retries=10

postgres:
image: postgres:13
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
POSTGRES_DB: testbench
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U root -d testbench"
--health-interval=10s
--health-timeout=5s
--health-retries=10

redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s
--health-timeout=5s
--health-retries=10

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
extensions: pdo_mysql, pdo_pgsql, pgsql, redis, xdebug
tools: composer:v2
coverage: xdebug

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-copilot-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-copilot-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Smoke test feature suite (MySQL + Redis)
env:
APP_KEY: base64:i3g6f+dV8FfsIkcxqd7gbiPn2oXk5r00sTmdD6V5utI=
DB_CONNECTION: mysql
DB_DATABASE: testbench
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
DB_PASSWORD: password
QUEUE_CONNECTION: redis
QUEUE_FAILED_DRIVER: "null"
REDIS_HOST: 127.0.0.1
REDIS_PASSWORD:
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
php -r '$pdo = new PDO(sprintf("mysql:host=127.0.0.1;port=%s", getenv("MYSQL_PORT")), "root", "password"); $pdo->exec("CREATE DATABASE IF NOT EXISTS testbench");'
vendor/bin/phpunit --testdox --testsuite feature --filter AsyncWorkflowTest

- name: Smoke test feature suite (PostgreSQL + Redis)
env:
APP_KEY: base64:i3g6f+dV8FfsIkcxqd7gbiPn2oXk5r00sTmdD6V5utI=
DB_CONNECTION: pgsql
DB_DATABASE: testbench
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.postgres.ports[5432] }}
DB_USERNAME: root
DB_PASSWORD: password
QUEUE_CONNECTION: redis
QUEUE_FAILED_DRIVER: "null"
REDIS_HOST: 127.0.0.1
REDIS_PASSWORD:
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
run: vendor/bin/phpunit --testdox --testsuite feature --filter AsyncWorkflowTest
Loading