-
Notifications
You must be signed in to change notification settings - Fork 257
42 lines (35 loc) · 1.39 KB
/
copilot-setup-steps.yml
File metadata and controls
42 lines (35 loc) · 1.39 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
name: "Copilot Setup Steps"
# See https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
permissions: {}
jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-24.04
# Install PostgreSQL via a docker container.
# It's better to do this rather than e.g. use a testcontainer, because then the agent can reuse the same container
# and instance of PostgreSQL rather than have to start it up each time it needs to iterate and run a test.
services:
postgres:
image: postgis/postgis:latest
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: MySecret
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Export connection string for the agent's session
run: echo "Test__Npgsql__DefaultConnection=Server=localhost;Database=postgres;Username=postgres;Password=MySecret" >> "$GITHUB_ENV"