-
-
Notifications
You must be signed in to change notification settings - Fork 63
126 lines (112 loc) · 3.87 KB
/
copilot-setup-steps.yml
File metadata and controls
126 lines (112 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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: Export GitHub Actions test defaults
run: |
echo "APP_KEY=base64:i3g6f+dV8FfsIkcxqd7gbiPn2oXk5r00sTmdD6V5utI=" >> "$GITHUB_ENV"
echo "DB_HOST=127.0.0.1" >> "$GITHUB_ENV"
echo "DB_DATABASE=testbench" >> "$GITHUB_ENV"
echo "DB_USERNAME=root" >> "$GITHUB_ENV"
echo "DB_PASSWORD=password" >> "$GITHUB_ENV"
echo "REDIS_HOST=127.0.0.1" >> "$GITHUB_ENV"
- 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