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
40 changes: 40 additions & 0 deletions copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

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
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;Port=5432;Database=postgres;SSL Mode=disable" >> "$GITHUB_ENV"