Skip to content

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
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
57 changes: 57 additions & 0 deletions copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# GitHub Copilot setup steps for OpenVMM development environment
# Based on the devcontainer configuration and getting started documentation

steps:
- name: Install Rust with required targets
run: |
# Install Rust using rustup (tracks latest stable as per project requirements)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
source ~/.cargo/env

# Install all required targets for OpenVMM cross-compilation
rustup target add aarch64-apple-darwin
rustup target add aarch64-unknown-linux-musl
rustup target add x86_64-pc-windows-msvc
rustup target add x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl
rustup target add x86_64-unknown-none
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it simple. Don't cross compile, just add targets for the architecture that matches the cpu environment where the agent runs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified the target installation to dynamically detect host architecture and only install the matching musl target. Fixed in commit 19b2ceb.


- name: Install system dependencies
run: |
# Update package lists
sudo apt-get update

# Install build dependencies required for OpenVMM
sudo apt-get install -y \
binutils \
build-essential \
gcc-aarch64-linux-gnu \
libssl-dev \
pkg-config

- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also install cargo-nextest so that you can run unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added cargo-nextest installation step as requested. Fixed in commit d2abb45.


- name: Set up development tools
run: |
# Install git hooks for automatic formatting (recommended)
cargo xtask install-git-hooks --pre-push --with-fmt=yes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required, as long as the agent runs cargo xtask fmt --fix before pushing changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the development tools setup step since the agent will run cargo xtask fmt --fix before pushing changes. Fixed in commit 9c25f10.


- name: Verify installation
run: |
# Verify that Rust and required tools are installed
rustc --version
cargo --version

# Check that required targets are installed
rustup target list --installed

# Run formatting checks to ensure environment is set up correctly
cargo xtask fmt

# Test that basic workspace check works
cargo check --workspace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't particularly see the value in this. The agent will find that things fail if the environment is not set up correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the verification section as the agent will discover failures naturally if the environment isn't set up correctly. Fixed in commit 9c25f10.