Skip to content

Commit 0c06083

Browse files
committed
Add Copilot setup steps to install PG (#3752)
1 parent 9493cfc commit 0c06083

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
name: "Copilot Setup Steps"
3+
4+
# See https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment
5+
6+
# Automatically run the setup steps when they are changed to allow for easy validation, and
7+
# allow manual testing through the repository's "Actions" tab
8+
on:
9+
workflow_dispatch:
10+
push:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
pull_request:
14+
paths:
15+
- .github/workflows/copilot-setup-steps.yml
16+
17+
permissions: {}
18+
19+
jobs:
20+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
21+
copilot-setup-steps:
22+
runs-on: ubuntu-24.04
23+
24+
# Install PostgreSQL via a docker container.
25+
# It's better to do this rather than e.g. use a testcontainer, because then the agent can reuse the same container
26+
# and instance of PostgreSQL rather than have to start it up each time it needs to iterate and run a test.
27+
services:
28+
postgres:
29+
image: postgis/postgis:latest
30+
ports:
31+
- 5432:5432
32+
environment:
33+
POSTGRES_PASSWORD: TempSecret
34+
options: >-
35+
--health-cmd pg_isready
36+
--health-interval 10s
37+
--health-timeout 5s
38+
--health-retries 5
39+
40+
steps:
41+
- name: Export connection string for the agent's session
42+
run: echo "Test__Npgsql__DefaultConnection=Server=localhost;Database=postgres;Username=postgres;Password=MySecret" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)