microsoft/hve-core
Publicmirrored fromhttps://github.com/microsoft/hve-coreAvailable
.github/workflows/copilot-setup-steps.yml
100lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # SPDX-License-Identifier: MIT |
| 3 | # |
| 4 | # copilot-setup-steps.yml |
| 5 | # Pre-install tools and dependencies for GitHub Copilot Coding Agent |
| 6 | # Reference: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment |
| 7 | |
| 8 | name: "Copilot Setup Steps" |
| 9 | |
| 10 | # Copilot coding agent runs these steps internally before starting work. |
| 11 | # Use workflow_dispatch to manually validate the setup when desired. |
| 12 | on: |
| 13 | workflow_dispatch: |
| 14 | |
| 15 | # Minimal permissions |
| 16 | permissions: |
| 17 | contents: read |
| 18 | |
| 19 | concurrency: |
| 20 | group: ${{ github.workflow }}-${{ github.ref }} |
| 21 | cancel-in-progress: false |
| 22 | |
| 23 | jobs: |
| 24 | # Job MUST be named 'copilot-setup-steps' to be recognized by Copilot |
| 25 | copilot-setup-steps: |
| 26 | runs-on: ubuntu-latest |
| 27 | |
| 28 | # Minimal permissions; Copilot receives its own token for operations |
| 29 | permissions: |
| 30 | contents: read |
| 31 | |
| 32 | steps: |
| 33 | - name: Checkout code |
| 34 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2 |
| 35 | with: |
| 36 | persist-credentials: false |
| 37 | |
| 38 | - name: Set up Node.js |
| 39 | uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 |
| 40 | with: |
| 41 | node-version: "20" |
| 42 | cache: "npm" |
| 43 | |
| 44 | # continue-on-error allows Copilot to start work even if dependencies fail, |
| 45 | # so it can fix package.json/package-lock.json issues itself |
| 46 | - name: Install JavaScript dependencies |
| 47 | continue-on-error: true |
| 48 | run: npm ci |
| 49 | |
| 50 | - name: Set up Python |
| 51 | uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 52 | with: |
| 53 | python-version: "3.11" |
| 54 | |
| 55 | - name: Install actionlint |
| 56 | env: |
| 57 | ACTIONLINT_VERSION: '1.7.10' |
| 58 | ACTIONLINT_SHA256: 'f4c76b71db5755a713e6055cbb0857ed07e103e028bda117817660ebadb4386f' |
| 59 | run: | |
| 60 | curl -sLO "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" |
| 61 | echo "${ACTIONLINT_SHA256} actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" | sha256sum -c - |
| 62 | tar -xzf "actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" actionlint |
| 63 | sudo install actionlint /usr/local/bin/actionlint |
| 64 | rm actionlint "actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" |
| 65 | actionlint --version |
| 66 | |
| 67 | - name: Install PowerShell modules |
| 68 | shell: pwsh |
| 69 | run: | |
| 70 | Install-Module -Name PowerShell-Yaml -Force -Scope CurrentUser |
| 71 | Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser |
| 72 | Install-Module -Name Pester -RequiredVersion 5.7.1 -Force -Scope CurrentUser |
| 73 | |
| 74 | - name: Install uv package manager |
| 75 | env: |
| 76 | UV_VERSION: '0.10.8' |
| 77 | UV_SHA256: 'f0c566b55683395a62fefb9261a060fa09824914b5682c3b9629fa154762ae2f' |
| 78 | run: | |
| 79 | curl -sSfL "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-x86_64-unknown-linux-gnu.tar.gz" -o /tmp/uv.tar.gz |
| 80 | echo "${UV_SHA256} /tmp/uv.tar.gz" | sha256sum -c - |
| 81 | sudo tar -xzf /tmp/uv.tar.gz -C /usr/local/bin --strip-components=1 uv-x86_64-unknown-linux-gnu/uv uv-x86_64-unknown-linux-gnu/uvx |
| 82 | rm /tmp/uv.tar.gz |
| 83 | uv --version |
| 84 | uvx --version |
| 85 | find .github/skills -name pyproject.toml -execdir uv sync \; |
| 86 | |
| 87 | - name: Verify tool availability |
| 88 | run: | |
| 89 | echo "=== Tool Versions ===" |
| 90 | node --version |
| 91 | npm --version |
| 92 | python3 --version |
| 93 | pwsh --version |
| 94 | shellcheck --version |
| 95 | actionlint --version |
| 96 | uv --version |
| 97 | uvx --version |
| 98 | echo "" |
| 99 | echo "=== npm Scripts Available ===" |
| 100 | npm run --list |
| 101 | |