-
Notifications
You must be signed in to change notification settings - Fork 3.4k
70 lines (61 loc) · 2.59 KB
/
copilot-setup-steps.yml
File metadata and controls
70 lines (61 loc) · 2.59 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
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
jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
permissions:
contents: read # Read permission is required to check out the repository's code.
runs-on: ubuntu-24.04
# Install SQL Server 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 SQL Server rather than have to start it up each time it needs to iterate and run a test.
services:
mssql:
image: mcr.microsoft.com/mssql/server:2025-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: 'PLACEHOLDERPass$$w0rd'
ports:
- 1433:1433
options: >-
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -Q 'SELECT 1' -C"
--health-start-period=20s
--health-interval=2s
--health-retries=30
--health-timeout=5s
cosmosdb:
image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview
ports:
- 8081:8081
env:
PROTOCOL: https
ENABLE_EXPLORER: "false"
options: >-
--health-cmd="curl -k https://localhost:8081/ || exit 1"
--health-start-period=120s
--health-interval=5s
--health-retries=60
--health-timeout=5s
steps:
- uses: actions/checkout@v6
- name: Restore .NET SDK
continue-on-error: true
run: ./restore.sh
- name: Export environment variables for the agent's session
run: |
echo "Test__SqlServer__DefaultConnection=Server=localhost;Database=test;User=SA;Password=PLACEHOLDERPass$$w0rd;Connect Timeout=60;ConnectRetryCount=0;Trust Server Certificate=true" >> "$GITHUB_ENV"
echo "Test__Cosmos__DefaultConnection=https://localhost:8081" >> "$GITHUB_ENV"
echo "Test__Cosmos__EmulatorType=linux" >> "$GITHUB_ENV"
echo "Test__Cosmos__SkipConnectionCheck=true" >> "$GITHUB_ENV"
echo "DOTNET_ROOT=$PWD/.dotnet/" >> "$GITHUB_ENV"
echo "$PWD/.dotnet/" >> $GITHUB_PATH