From b1fda0c0030c203f8ba6a1722bd43f910536abab Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Wed, 25 Feb 2026 14:10:54 +0100 Subject: [PATCH] Add Copilot setup steps to install PG --- copilot-setup-steps.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 copilot-setup-steps.yml diff --git a/copilot-setup-steps.yml b/copilot-setup-steps.yml new file mode 100644 index 000000000..a949df76c --- /dev/null +++ b/copilot-setup-steps.yml @@ -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"