-
Notifications
You must be signed in to change notification settings - Fork 133
Add copilot-setup-steps.yml for GitHub Copilot Coding Agent #1662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
10
commits into
main
Choose a base branch
from
copilot/fix-bc6f984b-8613-4d0f-8b2f-14c87cec1166
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
31c3c96
Initial plan
Copilot 97e11e2
Add copilot-setup-steps.yml for GitHub Copilot Coding Agent
Copilot 9c25f10
Address PR feedback: add copyright header, remove git hooks and verif…
Copilot 22b8382
Simplify Rust target installation to match host architecture only
Copilot d2abb45
Add cargo-nextest installation to copilot setup steps
Copilot c194e8e
Implement flowey-generated copilot-setup-steps.yml with version manag…
Copilot 68b67a0
Address PR feedback: move to .github/workflows/, use template approac…
Copilot 8fae204
Address PR feedback: move copyright header to template
Copilot fedeea8
Transform copilot-setup-steps.yml to proper GitHub Actions workflow f…
Copilot 790779a
Add checkout step before restore-packages in copilot setup workflow
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
############################## | ||
# THIS FILE IS AUTOGENERATED # | ||
# DO NOT MANUALLY EDIT # | ||
############################## | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
# GitHub Copilot setup steps for OpenVMM development environment | ||
# Generated by flowey_hvlite - DO NOT EDIT MANUALLY | ||
|
||
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.yaml | ||
pull_request: | ||
paths: | ||
- .github/workflows/copilot-setup-steps.yaml | ||
|
||
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 | ||
|
||
steps: | ||
- name: Install Rust with required targets | ||
run: | | ||
# Install Rust using rustup (version managed by flowey) | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.88.0 | ||
source ~/.cargo/env | ||
|
||
# Install targets for the host architecture | ||
ARCH=$(uname -m) | ||
if [ "$ARCH" = "x86_64" ]; then | ||
rustup target add x86_64-unknown-linux-musl | ||
elif [ "$ARCH" = "aarch64" ]; then | ||
rustup target add aarch64-unknown-linux-musl | ||
fi | ||
|
||
- name: Install system dependencies | ||
run: | | ||
# Update package lists with retry logic (from CI pipelines) | ||
set -x | ||
i=0; while [ $i -lt 5 ] && ! sudo apt-get update; do let "i=i+1"; sleep 1; done; | ||
|
||
# Install build dependencies required for OpenVMM | ||
sudo apt-get -o DPkg::Lock::Timeout=60 install -y \ | ||
binutils \ | ||
build-essential \ | ||
gcc \ | ||
gcc-aarch64-linux-gnu \ | ||
libssl-dev \ | ||
pkg-config | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Restore OpenVMM build dependencies | ||
run: | | ||
# Restore external dependencies required for building OpenVMM | ||
# This includes protoc (Protocol Buffers compiler), mu_msvm UEFI firmware, | ||
# test Linux kernels, and other build artifacts | ||
cargo xflowey restore-packages | ||
|
||
# Install cargo-nextest for running unit tests (version managed by flowey) | ||
cargo install cargo-nextest --version 0.9.96 --locked |
30 changes: 30 additions & 0 deletions
30
flowey/flowey_hvlite/src/pipelines/copilot_setup_generator.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
use anyhow::Result; | ||
|
||
/// Generate copilot-setup-steps.yml for GitHub Copilot Coding Agent | ||
#[derive(clap::Args)] | ||
pub struct CopilotSetupGeneratorCli {} | ||
|
||
impl CopilotSetupGeneratorCli { | ||
pub fn run(self, repo_root: &std::path::Path) -> Result<()> { | ||
let output_file = repo_root.join(".github/workflows/copilot-setup-steps.yaml"); | ||
|
||
// Ensure the output directory exists | ||
if let Some(parent) = output_file.parent() { | ||
std::fs::create_dir_all(parent)?; | ||
} | ||
|
||
let content = generate_copilot_setup_steps(); | ||
|
||
std::fs::write(&output_file, content)?; | ||
|
||
println!("Generated .github/workflows/copilot-setup-steps.yaml"); | ||
Ok(()) | ||
} | ||
} | ||
|
||
fn generate_copilot_setup_steps() -> String { | ||
crate::pipelines_shared::copilot_setup_steps_template::get_template() | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
flowey/flowey_hvlite/src/pipelines_shared/copilot_setup_steps_template.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
//! See [`get_template`] | ||
|
||
/// Get our internal copilot setup steps template. | ||
/// | ||
/// This template provides the steps needed to set up the OpenVMM development | ||
/// environment for GitHub Copilot's Coding Agent. | ||
pub fn get_template() -> String { | ||
let template = include_str!("copilot_setup_steps_template.yml").to_string(); | ||
|
||
template | ||
.replace( | ||
"{{RUSTUP_TOOLCHAIN}}", | ||
flowey_lib_hvlite::_jobs::cfg_versions::RUSTUP_TOOLCHAIN, | ||
) | ||
.replace( | ||
"{{NEXTEST_VERSION}}", | ||
flowey_lib_hvlite::_jobs::cfg_versions::NEXTEST, | ||
) | ||
} |
76 changes: 76 additions & 0 deletions
76
flowey/flowey_hvlite/src/pipelines_shared/copilot_setup_steps_template.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
############################## | ||
# THIS FILE IS AUTOGENERATED # | ||
# DO NOT MANUALLY EDIT # | ||
############################## | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
# GitHub Copilot setup steps for OpenVMM development environment | ||
# Generated by flowey_hvlite - DO NOT EDIT MANUALLY | ||
|
||
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.yaml | ||
pull_request: | ||
paths: | ||
- .github/workflows/copilot-setup-steps.yaml | ||
|
||
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 | ||
|
||
steps: | ||
- name: Install Rust with required targets | ||
run: | | ||
# Install Rust using rustup (version managed by flowey) | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain={{RUSTUP_TOOLCHAIN}} | ||
source ~/.cargo/env | ||
|
||
# Install targets for the host architecture | ||
ARCH=$(uname -m) | ||
if [ "$ARCH" = "x86_64" ]; then | ||
rustup target add x86_64-unknown-linux-musl | ||
elif [ "$ARCH" = "aarch64" ]; then | ||
rustup target add aarch64-unknown-linux-musl | ||
fi | ||
|
||
- name: Install system dependencies | ||
run: | | ||
# Update package lists with retry logic (from CI pipelines) | ||
set -x | ||
i=0; while [ $i -lt 5 ] && ! sudo apt-get update; do let "i=i+1"; sleep 1; done; | ||
|
||
# Install build dependencies required for OpenVMM | ||
sudo apt-get -o DPkg::Lock::Timeout=60 install -y \ | ||
binutils \ | ||
build-essential \ | ||
gcc \ | ||
gcc-aarch64-linux-gnu \ | ||
libssl-dev \ | ||
pkg-config | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Restore OpenVMM build dependencies | ||
run: | | ||
# Restore external dependencies required for building OpenVMM | ||
# This includes protoc (Protocol Buffers compiler), mu_msvm UEFI firmware, | ||
# test Linux kernels, and other build artifacts | ||
cargo xflowey restore-packages | ||
|
||
# Install cargo-nextest for running unit tests (version managed by flowey) | ||
cargo install cargo-nextest --version {{NEXTEST_VERSION}} --locked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be generated at
.github/workflows/copilot-setup-steps.yml
, relative to the repo root.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! The file is now generated at
.github/workflows/copilot-setup-steps.yml
as requested. Changes in commit 68b67a0.