Skip to content

Commit 55323e5

Browse files
authored
Add Copilot setup workflow (#356)
1 parent 08d0200 commit 55323e5

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: "Copilot Setup Steps"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
pull_request:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
12+
jobs:
13+
copilot-setup-steps:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 30
16+
17+
permissions:
18+
contents: read
19+
20+
services:
21+
mysql:
22+
image: mysql:8.0
23+
env:
24+
MYSQL_ROOT_PASSWORD: password
25+
MYSQL_DATABASE: testbench
26+
ports:
27+
- 3306:3306
28+
options: >-
29+
--health-cmd="mysqladmin ping -ppassword"
30+
--health-interval=10s
31+
--health-timeout=5s
32+
--health-retries=10
33+
34+
postgres:
35+
image: postgres:13
36+
env:
37+
POSTGRES_USER: root
38+
POSTGRES_PASSWORD: password
39+
POSTGRES_DB: testbench
40+
ports:
41+
- 5432:5432
42+
options: >-
43+
--health-cmd="pg_isready -U root -d testbench"
44+
--health-interval=10s
45+
--health-timeout=5s
46+
--health-retries=10
47+
48+
redis:
49+
image: redis:7-alpine
50+
ports:
51+
- 6379:6379
52+
options: >-
53+
--health-cmd="redis-cli ping"
54+
--health-interval=10s
55+
--health-timeout=5s
56+
--health-retries=10
57+
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v5
61+
62+
- name: Set up PHP
63+
uses: shivammathur/setup-php@v2
64+
with:
65+
php-version: "8.1"
66+
extensions: pdo_mysql, pdo_pgsql, pgsql, redis, xdebug
67+
tools: composer:v2
68+
coverage: xdebug
69+
70+
- name: Validate composer.json and composer.lock
71+
run: composer validate --strict
72+
73+
- name: Cache Composer packages
74+
uses: actions/cache@v4
75+
with:
76+
path: vendor
77+
key: ${{ runner.os }}-copilot-php-${{ hashFiles('**/composer.lock') }}
78+
restore-keys: |
79+
${{ runner.os }}-copilot-php-
80+
81+
- name: Install dependencies
82+
run: composer install --prefer-dist --no-progress --no-interaction
83+
84+
- name: Smoke test feature suite (MySQL + Redis)
85+
env:
86+
APP_KEY: base64:i3g6f+dV8FfsIkcxqd7gbiPn2oXk5r00sTmdD6V5utI=
87+
DB_CONNECTION: mysql
88+
DB_DATABASE: testbench
89+
DB_HOST: 127.0.0.1
90+
DB_PORT: ${{ job.services.mysql.ports[3306] }}
91+
DB_USERNAME: root
92+
DB_PASSWORD: password
93+
QUEUE_CONNECTION: redis
94+
QUEUE_FAILED_DRIVER: "null"
95+
REDIS_HOST: 127.0.0.1
96+
REDIS_PASSWORD:
97+
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
98+
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
99+
run: |
100+
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");'
101+
vendor/bin/phpunit --testdox --testsuite feature --filter AsyncWorkflowTest
102+
103+
- name: Smoke test feature suite (PostgreSQL + Redis)
104+
env:
105+
APP_KEY: base64:i3g6f+dV8FfsIkcxqd7gbiPn2oXk5r00sTmdD6V5utI=
106+
DB_CONNECTION: pgsql
107+
DB_DATABASE: testbench
108+
DB_HOST: 127.0.0.1
109+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
110+
DB_USERNAME: root
111+
DB_PASSWORD: password
112+
QUEUE_CONNECTION: redis
113+
QUEUE_FAILED_DRIVER: "null"
114+
REDIS_HOST: 127.0.0.1
115+
REDIS_PASSWORD:
116+
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
117+
run: vendor/bin/phpunit --testdox --testsuite feature --filter AsyncWorkflowTest

0 commit comments

Comments
 (0)