A repository uses Copilot coding agent to work on a Python API that requires PostgreSQL during local validation. The team adds a setup workflow so Copilot can install dependencies and run a smoke test before it starts work. Evaluate the following statements. 1. The job name allows Copilot to use the setup steps. 2. The PostgreSQL service helps reproduce a project-specific environment dependency. 3. Changing runs-on to macos-latest would be supported for Copilot cloud agent setup.
name: Copilot Setup Steps
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: app
POSTGRES_PASSWORD: app
POSTGRES_DB: app_test
ports:
- 5432:5432
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install -r requirements-dev.txt
- name: Run smoke tests
env:
DATABASE_URL: postgresql://app:app@localhost:5432/app_test
run: pytest tests/smoke -qChoose an answer
Tap an option to check your answer.
Correct answer: 1=Yes 2=Yes 3=No.
Why this is the answer
Statement 1 is correct because the job name copilot-setup-steps is explicitly referenced by Copilot to identify and execute the setup steps defined within this workflow. This naming convention allows Copilot to integrate these steps into its workflow. Statement 2 is correct because the services block, specifically the postgres service, creates a PostgreSQL container that mirrors the production database environment, enabling accurate local validation and smoke testing for the Python API. This directly addresses the need for a project-specific environment dependency. Statement 3 is incorrect because Copilot's cloud agent setup currently only supports Linux-based runners. Changing runs-on to macos-latest would not be supported for Copilot's cloud agent.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed