-
Notifications
You must be signed in to change notification settings - Fork 8
Create static GitHub Copilot instructions file and restore environment setup workflow #771
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
Merged
BenjaminMichaelis
merged 11 commits into
main
from
copilot/fix-fde5fa8c-b82a-4f64-b892-775e442dc677
Aug 29, 2025
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8396b17
Initial plan
Copilot 5376714
Add initial copilot-setup-steps.yml workflow
Copilot f973a70
Enhance copilot-setup-steps.yml with comprehensive tooling and instru…
Copilot 79bdbee
Finalize copilot-setup-steps.yml - remove unnecessary Node.js caching
Copilot 7ceea8c
Simplify copilot-setup-steps.yml to generate instructions file only
Copilot 0427302
Create static copilot-instructions.md and restore environment setup w…
Copilot c18fe77
Update .github/workflows/copilot-setup-steps.yml
BenjaminMichaelis 5cf396c
Update .github/workflows/copilot-setup-steps.yml
BenjaminMichaelis 11ef8df
Update .github/workflows/copilot-setup-steps.yml
BenjaminMichaelis 44a1433
Update .github/workflows/copilot-setup-steps.yml
BenjaminMichaelis 9cc8d23
update
BenjaminMichaelis 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,208 @@ | ||
| name: Setup GitHub Copilot Agent Environment | ||
|
|
||
| # This workflow configures the environment for GitHub Copilot agents | ||
| # It reuses configuration from the main Build-Test-And-Deploy workflow | ||
| # to ensure consistency and reduce duplication | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| setup-environment: | ||
| runs-on: ubuntu-latest | ||
| environment: "BuildAndUploadImage" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up .NET Core | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| global-json-file: global.json | ||
| source-url: https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json | ||
| env: | ||
| NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_PAT }} | ||
|
|
||
| - name: Set up dependency caching for faster builds | ||
| uses: actions/cache@v4 | ||
| id: nuget-cache | ||
| with: | ||
| path: | | ||
| ~/.nuget/packages | ||
| ${{ github.workspace }}/**/obj/project.assets.json | ||
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | ||
| ${{ runner.os }}-nuget- | ||
|
|
||
| - name: Restore with dotnet | ||
| run: dotnet restore | ||
|
|
||
| - name: Build with dotnet | ||
| run: dotnet build -p:ContinuousIntegrationBuild=True -p:ReleaseDateAttribute=True --configuration Release --no-restore | ||
|
|
||
| - name: Run .NET Tests | ||
| run: dotnet test --no-build --configuration Release | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Validate Docker build | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| push: false | ||
| tags: copilot-env-validation | ||
| file: ./EssentialCSharp.Web/Dockerfile | ||
| context: . | ||
| secrets: | | ||
| "nuget_auth_token=${{ secrets.AZURE_DEVOPS_PAT }}" | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Set up Node.js for frontend development | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install additional development tools | ||
| run: | | ||
| # Install common development tools that Copilot agents might need | ||
| echo "Installing additional tools for Copilot agent environment..." | ||
|
|
||
| # Install Azure CLI for cloud operations | ||
| curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash | ||
|
|
||
| # Install GitHub CLI for repository operations | ||
| type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) | ||
| curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg | ||
| sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg | ||
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | ||
| sudo apt update && sudo apt install gh -y | ||
|
|
||
| # Install EF Core tools globally | ||
| dotnet tool install --global dotnet-ef | ||
|
|
||
| - name: Validate development tools | ||
| run: | | ||
| echo "🔍 Validating installed tools..." | ||
| echo "Azure CLI: $(az --version | head -1 || echo 'Not available')" | ||
| echo "GitHub CLI: $(gh --version | head -1 || echo 'Not available')" | ||
BenjaminMichaelis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| echo "EF Core CLI: $(dotnet ef --version || echo 'Not available')" | ||
| echo "Node.js: $(node --version || echo 'Not available')" | ||
| echo "npm: $(npm --version || echo 'Not available')" | ||
|
|
||
| - name: Create Copilot instructions file | ||
BenjaminMichaelis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| run: | | ||
| mkdir -p .github | ||
| cat << 'EOF' > .github/copilot-instructions.md | ||
| # GitHub Copilot Instructions for EssentialCSharp.Web | ||
|
|
||
| This is an ASP.NET Core 9.0 web application with the following characteristics: | ||
|
|
||
| ## Project Structure | ||
| - **EssentialCSharp.Web**: Main web application using ASP.NET Core, Razor Pages, Identity | ||
| - **EssentialCSharp.Chat**: Console application for AI chat functionality using Semantic Kernel | ||
| - **EssentialCSharp.Chat.Shared**: Shared libraries between projects | ||
| - **EssentialCSharp.Web.Tests**: xUnit integration tests | ||
| - **EssentialCSharp.Chat.Tests**: xUnit unit tests | ||
|
|
||
| ## Key Technologies | ||
| - .NET 9.0 with C# 13 | ||
| - ASP.NET Core with Razor Pages | ||
| - Entity Framework Core with SQL Server | ||
| - ASP.NET Core Identity for authentication | ||
| - Microsoft Semantic Kernel for AI integration | ||
| - Azure OpenAI for chat functionality | ||
| - Docker containerization | ||
| - Azure Application Insights for telemetry | ||
| - GitHub and Microsoft OAuth authentication | ||
|
|
||
| ## Development Patterns | ||
| - Use centralized package management (Directory.Packages.props) | ||
| - Follow Repository pattern for data access | ||
| - Use dependency injection throughout | ||
| - Implement proper error handling and logging | ||
| - Include comprehensive integration tests | ||
| - Use async/await patterns consistently | ||
|
|
||
| ## Build and Test Commands | ||
| ```bash | ||
| # Restore packages | ||
| dotnet restore | ||
|
|
||
| # Build solution | ||
| dotnet build --configuration Release --no-restore | ||
|
|
||
| # Run tests | ||
| dotnet test --no-build --configuration Release | ||
|
|
||
| # Run specific project | ||
| dotnet run --project EssentialCSharp.Web | ||
| ``` | ||
|
|
||
| ## Docker | ||
| - Dockerfile in EssentialCSharp.Web/ directory | ||
| - Multi-stage build with .NET 9 runtime | ||
| - Requires ACCESS_TO_NUGET_FEED build arg for private packages | ||
|
|
||
| ## Configuration | ||
| - Uses appsettings.json + user secrets + environment variables | ||
| - Key secrets: GitHub/Microsoft OAuth, database connection, AI endpoints | ||
| - See README.md for required configuration values | ||
|
|
||
| ## AI Integration | ||
| - Uses Azure OpenAI through Semantic Kernel | ||
| - Vector database with PostgreSQL + pgvector | ||
| - Chat functionality in EssentialCSharp.Chat project | ||
| - Embedding generation and retrieval | ||
| EOF | ||
|
|
||
| - name: Test Copilot agent environment | ||
| run: | | ||
| echo "🧪 Testing Copilot agent environment capabilities..." | ||
|
|
||
| # Test basic .NET commands | ||
| dotnet --list-sdks | ||
| dotnet --list-runtimes | ||
|
|
||
| # Test EF Core tools | ||
| dotnet ef --help > /dev/null && echo "✅ EF Core tools working" | ||
|
|
||
| # Test that we can create a simple project (cleanup afterwards) | ||
| cd /tmp | ||
| dotnet new console -n TestCopilotEnv | ||
| cd TestCopilotEnv | ||
| dotnet build | ||
| cd .. | ||
| rm -rf TestCopilotEnv | ||
| echo "✅ Project creation and build test passed" | ||
|
|
||
| # Test Docker functionality | ||
| docker --version | ||
| echo "✅ Docker available" | ||
|
|
||
| # Test that our solution is properly restored and built | ||
| cd ${{ github.workspace }} | ||
| echo "✅ Solution build completed successfully" | ||
BenjaminMichaelis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Display environment information | ||
| run: | | ||
| echo "✅ Environment setup complete for GitHub Copilot agents" | ||
| echo "📦 .NET Version: $(dotnet --version)" | ||
| echo "🏗️ Build Status: Success" | ||
| echo "🐳 Docker Status: Ready" | ||
| echo "📂 Repository: ${{ github.repository }}" | ||
| echo "🔧 This environment is configured for:" | ||
| echo " - .NET 9.0 development with C# 13" | ||
| echo " - ASP.NET Core web applications" | ||
| echo " - Entity Framework with SQL Server" | ||
| echo " - Semantic Kernel AI integration" | ||
| echo " - Azure OpenAI and vector databases" | ||
| echo " - Docker containerization" | ||
| echo " - Azure CLI and GitHub CLI tools" | ||
| echo " - NuGet package management (public and private feeds)" | ||
| echo " - Node.js for frontend tooling" | ||
| echo "📖 Copilot instructions created at .github/copilot-instructions.md" | ||
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.
Uh oh!
There was an error while loading. Please reload this page.