์ฐธ๊ณ ํญ๋ชฉ
Copilot ์ฝ๋ฉ ์์ด์ ํธ๋ ๊ณต๊ฐ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ ๋ฒ์ ์ด๋ฉฐ ๋ณ๊ฒฝ๋ ์ ์์ต๋๋ค. ๋ฏธ๋ฆฌ ๋ณด๊ธฐ ์ค ๊ธฐ๋ฅ์ ์ฌ์ฉ์ GitHub ์ํํ ์ฌ์ฉ ์กฐ๊ฑด์(๋ฅผ) ๋ฐ๋ฆ ๋๋ค.
Copilot ์ฝ๋ฉ ์์ด์ ํธ์ ๊ฐ๋ฐ ํ๊ฒฝ ์ฌ์ฉ์ ์ง์ ์ ๋ณด
์์ ์ ์ํํ๋ ๋์ Copilot์ GitHub Actions๋ก ๊ตฌ๋๋๋ ์์ฒด ์์ ๊ฐ๋ฐ ํ๊ฒฝ์ ์ก์ธ์คํ ์ ์์ต๋๋ค. Copilot์ ์ฌ์ฉ์์ ์ฝ๋๋ฅผ ์ดํด๋ณด๊ณ , ํ์ํ ๋ถ๋ถ์ ๋ณ๊ฒฝํ๊ณ , ์๋ํ๋ ํ ์คํธ ๋ฐ Linter๋ฅผ ์คํํ๋ ๋ฑ์ ์์ ์ ์งํํ ์ ์์ต๋๋ค.
๋ค์์ ํตํด Copilot์ ํ๊ฒฝ์ ์ฌ์ฉ์ ์ง์ ํ ์ ์์ต๋๋ค.
- Copilot์ ํ๊ฒฝ์ ๋๊ตฌ ๋๋ ์ข ์์ฑ์ ๋ฏธ๋ฆฌ ์ค์น
- Copilot์ ํ๊ฒฝ์์ ํ๊ฒฝ ๋ณ์ ์ค์
- ํ์ค GitHub ํธ์คํ GitHub Actions ์คํ๊ธฐ์์ ๋ํ ์คํ๊ธฐ๋ก ์ ๊ทธ๋ ์ด๋
- Git LFS(๋ํ ํ์ผ ์คํ ๋ฆฌ์ง)๋ฅผ ์ฌ์ฉํ๋๋ก ์ค์
- ์์ด์ ํธ์ ๋ฐฉํ๋ฒฝ์ ์ฌ์ฉํ์ง ์๋๋ก ์ค์ ํ๊ฑฐ๋ ์ฌ์ฉ์ ์ง์ ํฉ๋๋ค.
Copilot์ ํ๊ฒฝ์ ๋๊ตฌ ๋๋ ์ข ์์ฑ ์ฌ์ ์ค์น
์์ ๊ฐ๋ฐ ํ๊ฒฝ์์ Copilot์ ํ๋ก์ ํธ๋ฅผ ๋น๋ํ๊ฑฐ๋ ์ปดํ์ผํ ์ ์๊ณ , ์๋ํ๋ ํ ์คํธ, Linter, ๊ธฐํ ๋๊ตฌ๋ฅผ ์คํํ ์ ์์ต๋๋ค. ์ด๋ฌํ ์์ ์ ์ํํ๋ ค๋ฉด ํ๋ก์ ํธ์ ์ข ์์ฑ์ ์ค์นํด์ผ ํฉ๋๋ค.
Copilot์ ์ํ์ฐฉ์ค๋ฅผ ํตํด ์ข ์์ฑ์ ์ค์ค๋ก ๋ฐ๊ฒฌํ๊ณ ์ค์นํ ์ ์์ง๋ง, LLM(๋๊ท๋ชจ ์ธ์ด ๋ชจ๋ธ)์ ๋น๊ฒฐ์ ์ ์ธ ํน์ฑ ๋๋ฌธ์ ์ด ๊ณผ์ ์ด ๋๋ฆฌ๊ฑฐ๋ ์ ๋ขฐํ ์ ์์ ์ ์์ต๋๋ค. ๊ฒฝ์ฐ์ ๋ฐ๋ผ ์ข ์์ฑ์ ๋ค์ด๋ก๋ํ ์ ์๋ ๊ฒฝ์ฐ๋ ์์ต๋๋ค(์: ๋น๊ณต๊ฐ ์ข ์์ฑ์ธ ๊ฒฝ์ฐ).
๋์ , ๋ฆฌํฌ์งํ ๋ฆฌ ๋ด์ .github/workflows/copilot-setup-steps.yml
์ ํน๋ณํ GitHub Actions ์ํฌํ๋ก ํ์ผ์ ๋ง๋ค์ด ์์ด์ ํธ๊ฐ ์์๋๊ธฐ ์ ์ Copilot์ ํ๊ฒฝ์ ๋ฏธ๋ฆฌ ๊ตฌ์ฑํ ์ ์์ต๋๋ค.
copilot-setup-steps.yml
ํ์ผ์ ์ผ๋ฐ์ ์ธ GitHub Actions ์ํฌํ๋ก ํ์ผ์ฒ๋ผ ๋ณด์ด์ง๋ง, ๋ฐ๋์ ๋จ์ผ copilot-setup-steps
์์
์ ํฌํจํด์ผ ํฉ๋๋ค. ์ด ์์
์ Copilot์ด ์์
์ ์์ํ๊ธฐ ์ ์ GitHub Actions์์ ์คํ๋ฉ๋๋ค. GitHub Actions ์ํฌํ๋ก ํ์ผ์ ๋ํ ์์ธํ ๋ด์ฉ์ GitHub Actions์ ๋ํ ์ํฌํ๋ก ๊ตฌ๋ฌธ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
๋ค์์ ํ๋ก์ ํธ๋ฅผ ๋ณต์ ํ๊ณ , Node.js๋ฅผ ์ค์นํ๊ณ , ํ๋ก์ ํธ์ ์ข
์์ฑ์ ๋ค์ด๋ก๋ํ๊ณ ์บ์ํ๋ TypeScript ํ๋ก์ ํธ์ ๋ํ copilot-setup-steps.yml
ํ์ผ์ ๊ฐ๋จํ ์์
๋๋ค. ํ๋ก์ ํธ์ ์ธ์ด ๋ฐ ์ข
์์ฑ์ ๋ง๊ฒ ์ฌ์ฉ์ ์ง์ ํด์ผ ํฉ๋๋ค.
name: "Copilot Setup Steps" # 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: runs-on: ubuntu-latest # Set the permissions to the lowest permissions possible needed for your steps. # Copilot will be given its own token for its operations. permissions: # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete. contents: read # You can define any steps you want, and they will run before the agent starts. # If you do not check out your code, Copilot will do this for you. steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: "20" cache: "npm" - name: Install JavaScript dependencies run: npm ci
name: "Copilot Setup Steps"
# 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:
runs-on: ubuntu-latest
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read
# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install JavaScript dependencies
run: npm ci
copilot-setup-steps.yml
ํ์ผ์์ copilot-setup-steps
์์
์ ๋ค์์ ์ค์ ๋ง ์ฌ์ฉ์ ์ง์ ํ ์ ์์ต๋๋ค. ๋ค๋ฅธ ์ค์ ์ ์ฌ์ฉ์ ์ง์ ํ๋ ค๊ณ ํ๋ฉด ๋ณ๊ฒฝ ๋ด์ฉ์ด ๋ฌด์๋ฉ๋๋ค.
steps
(์์ ๋ด์ฉ ์ฐธ์กฐ)permissions
(์์ ๋ด์ฉ ์ฐธ์กฐ)runs-on
(์๋ ๋ด์ฉ ์ฐธ์กฐ)container
services
snapshot
timeout-minutes
(์ต๋๊ฐ:59
)
์ด๋ฌํ ์ต์ ์ ๋ํ ์์ธํ ๋ด์ฉ์ GitHub Actions์ ๋ํ ์ํฌํ๋ก ๊ตฌ๋ฌธ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
copilot-setup-steps.yml
ํ์ผ์ด ๋ณ๊ฒฝ๋ ๋ ์๋์ผ๋ก ์ผ๋ฐ GitHub Actions ์ํฌํ๋ก๋ก ์คํ๋๋ฏ๋ก ํ์ผ์ด ์ฑ๊ณต์ ์ผ๋ก ์คํ๋๋์ง ํ์ธํ ์ ์์ต๋๋ค. ํ์ผ์ ๋ง๋ค๊ฑฐ๋ ์์ ํ๋ ๋์ด์ค๊ธฐ ์์ฒญ์ ๋ค๋ฅธ ๊ฒ์ฌ์ ํจ๊ป ํ์๋ฉ๋๋ค.
yml ํ์ผ์ ๊ธฐ๋ณธ ๋ถ๊ธฐ์ ๋ณํฉํ ํ์๋ ์ธ์ ๋ ์ง ๋ฆฌํฌ์งํ ๋ฆฌ์ Actions ํญ์์ ์ํฌํ๋ก๋ฅผ ์๋์ผ๋ก ์คํํ์ฌ ๋ชจ๋ ๊ฒ์ด ์์๋๋ก ์๋ํ๋์ง ํ์ธํ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ ์ํฌํ๋ก ์๋ ์คํ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
Copilot์ด ์์ ์ ์์ํ๋ฉด ์ค์ ๋จ๊ณ๊ฐ ์คํ๋๊ณ ์ ๋ฐ์ดํธ๊ฐ ์ธ์ ๋ก๊ทธ์ ํ์๋ฉ๋๋ค. Copilot์ ์ธ์ ์ถ์ ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
์ด๋ค ์ค์ ๋จ๊ณ์์๋ 0์ด ์๋ ์ข ๋ฃ ์ฝ๋๋ฅผ ๋ฐํํ๋ฉฐ ์คํจํ ๊ฒฝ์ฐ, Copilot์ ๋๋จธ์ง ์ค์ ๋จ๊ณ๋ฅผ ๊ฑด๋๋ฐ๊ณ ํ์ฌ ๊ฐ๋ฐ ํ๊ฒฝ ์ํ๋ก ์์ ์ ์์ํฉ๋๋ค.
Copilot์ ํ๊ฒฝ์์ ํ๊ฒฝ ๋ณ์ ์ค์
Copilot์ ํ๊ฒฝ์์ ํ๊ฒฝ ๋ณ์๋ฅผ ์ค์ ํ์ฌ ์ก์ธ์ค ๊ถํ์ด ์๋ ๋๊ตฌ ๋๋ ์ข ์์ฑ์ ๊ตฌ์ฑํ๊ฑฐ๋ ์ธ์ฆํ ์ ์์ต๋๋ค.
Copilot์ ๋ํ ํ๊ฒฝ ๋ณ์๋ฅผ ์ค์ ํ๋ ค๋ฉด copilot
ํ๊ฒฝ์์ GitHub Actions ๋ณ์ ๋๋ ๋น๋ฐ์ ๋ง๋ญ๋๋ค. ๊ฐ์ ์ํธ ๋๋ API ํค์ ๊ฐ์ ์ค์ํ ์ ๋ณด๊ฐ ํฌํจ๋ ๊ฒฝ์ฐ GitHub Actions ๋น๋ฐ์ ์ฌ์ฉํ๋ ๊ฒ์ด ๊ฐ์ฅ ์ข์ต๋๋ค.
-
GitHub์์ ๋ฆฌํฌ์งํ ๋ฆฌ์ ๊ธฐ๋ณธ ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
-
๋ฆฌํฌ์งํ ๋ฆฌ ์ด๋ฆ ์๋์์ ์ค์ ์ ํด๋ฆญํฉ๋๋ค. "์ค์ " ํญ์ด ํ์๋์ง ์์ผ๋ฉด ๋๋กญ๋ค์ด ๋ฉ๋ด๋ฅผ ์ ํํ ๋ค์ ์ค์ ์ ํด๋ฆญํฉ๋๋ค.
-
์ผ์ชฝ ์ฌ์ด๋๋ฐ์์ ํ๊ฒฝ์ ํด๋ฆญํฉ๋๋ค.
-
copilot
ํ๊ฒฝ์ ํด๋ฆญํฉ๋๋ค. -
๋น๋ฐ์ ์ถ๊ฐํ๋ ค๋ฉด "Environment secrets"์์ Add environment secret์ ํด๋ฆญํฉ๋๋ค. ๋ณ์๋ฅผ ์ถ๊ฐํ๋ ค๋ฉด "Environment variables"์์ Add environment variable์ ํด๋ฆญํฉ๋๋ค.
-
"Name" ๋ฐ "Value" ํ๋๋ฅผ ์ ๋ ฅํ ๋ค์, Add secret ๋๋ Add variable์ ์ ์ ํ ํด๋ฆญํฉ๋๋ค.
๋ํ GitHub ํธ์คํ GitHub Actions ๋ฌ๋๋ก ์ ๊ทธ๋ ์ด๋
๊ธฐ๋ณธ์ ์ผ๋ก Copilot์ ์ ํ๋ ๋ฆฌ์์ค๊ฐ ์๋ ํ์ค GitHub Actions ๋ฌ๋์์ ์์ ํฉ๋๋ค.
๋์ , ๋ ๋ง์ RAM, CPU, ๋์คํฌ ๊ณต๊ฐ, ๊ณ ๊ธ ๋คํธ์ํน ์ ์ด ๋ฑ์ ๊ณ ๊ธ ๊ธฐ๋ฅ์ ๊ฐ์ถ ๋ํ ๋ฌ๋๋ฅผ ์ฌ์ฉํ๋๋ก ์ ํํ ์ ์์ต๋๋ค. ์ฑ๋ฅ์ด ์ ํ๋๋ ๊ฒฝ์ฐ(์: ์ข ์์ฑ์ ๋ค์ด๋ก๋ํ๊ฑฐ๋ ํ ์คํธ๋ฅผ ์คํํ๋ ๊ฒฝ์ฐ) ๋ํ ๋ฌ๋๋ก ์ ๊ทธ๋ ์ด๋ํ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ํ ์คํ๊ธฐ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
Copilot์์ ๋ํ ๋ฌ๋๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ๋จผ์ ํ๋ ์ด์์ ๋ํ ๋ฌ๋๋ฅผ ์ถ๊ฐํ๊ณ ๋ฆฌํฌ์งํ ๋ฆฌ์์ ์ด๋ฅผ ์ฌ์ฉํ๋๋ก ๊ตฌ์ฑํด์ผ ํฉ๋๋ค. ๋ํ ์คํ๊ธฐ ๊ด๋ฆฌํ๊ธฐ์(๋ฅผ) ์ฐธ์กฐํ์ธ์. ์ด ์์
์ ์ํํ ํ์๋ copilot-setup-steps.yml
ํ์ผ์ ์ฌ์ฉํ์ฌ Copilot์ ๋ํ ๋ฌ๋๋ฅผ ์ฌ์ฉํ๋๋ก ์ง์ํ ์ ์์ต๋๋ค.
๋ํ ๋ฌ๋๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด copilot-setup-steps
์์
์ runs-on
๋จ๊ณ๋ฅผ ๋ํ ๋ฌ๋์์ Copilot์ ์ฌ์ฉํ ๋ ์ด๋ธ ๋ฐ/๋๋ ๊ทธ๋ฃน์ผ๋ก ์ค์ ํฉ๋๋ค. runs-on
์ ์ฌ์ฉํ์ฌ ๋ํ ๋ฌ๋๋ฅผ ์ง์ ํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์์ธํ ๋ด์ฉ์ ๋ ํฐ ์คํ๊ธฐ์์ ์์
์คํ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
# ...
jobs:
copilot-setup-steps:
runs-on: ubuntu-4-core
# ...
์ฐธ๊ณ ํญ๋ชฉ
- Copilot ์ฝ๋ฉ ์์ด์ ํธ๋ Ubuntu x64 Linux ๋ฌ๋์๋ง ํธํ๋ฉ๋๋ค. Windows, macOS ๋๋ ๊ธฐํ ์ด์ ์ฒด์ ์ ๋ฌ๋๋ ์ง์๋์ง ์์ต๋๋ค.
- ์์ฒด ํธ์คํ GitHub Actions ๋ฌ๋๋ ์ง์๋์ง ์์ต๋๋ค.
Git LFS(๋ํ ํ์ผ ์คํ ๋ฆฌ์ง)๋ฅผ ์ฌ์ฉํ๋๋ก ์ค์
Git LFS(๋ํ ํ์ผ ์คํ ๋ฆฌ์ง)๋ฅผ ์ฌ์ฉํ์ฌ ๋ฆฌํฌ์งํ ๋ฆฌ์ ํฐ ํ์ผ์ ์ ์ฅํ๋ ๊ฒฝ์ฐ Copilot์ ํ๊ฒฝ์ ์ฌ์ฉ์ ์ง์ ํ์ฌ Git LFS๋ฅผ ์ค์นํ๊ณ LFS ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์์ผ ํฉ๋๋ค.
Git LFS๋ฅผ ์ฌ์ฉํ๋๋ก ์ค์ ํ๋ ค๋ฉด lfs
์ต์
์ true
๋ก ์ค์ ํ์ฌ copilot-setup-steps
์์
์ actions/checkout
๋จ๊ณ๋ฅผ ์ถ๊ฐํฉ๋๋ค.
# ... jobs: copilot-setup-steps: runs-on: ubuntu-latest permissions: contents: read # for actions/checkout steps: - uses: actions/checkout@v4 with: lfs: true
# ...
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout
steps:
- uses: actions/checkout@v4
with:
lfs: true