Skip to content

Migrate CI from AppVeyor to GitHub Actions - #2

Merged
AArnott merged 10 commits into
masterfrom
copilot/switch-to-github-actions
Nov 16, 2025
Merged

AArnott merged 10 commits into
masterfrom
copilot/switch-to-github-actions

Conversation

Copilot AI commented Nov 16, 2025 •

Copy link
Copy Markdown

Migration from AppVeyor to GitHub Actions ✅

Summary

Successfully migrated the StyleCopAnalyzers repository from AppVeyor CI to GitHub Actions. The new workflow maintains all the functionality of the previous AppVeyor build while following GitHub Actions best practices.

Changes Made:

1. Created GitHub Actions Workflow (.github/workflows/build.yml)

  • Platform: Windows latest
  • Configurations: Debug and Release (matrix build)
  • Triggers: Push to master branch (excluding tags) and pull requests to master
  • Build Steps:
    • Checkout with full git history
    • Configure git line endings (autocrlf=true, same as AppVeyor)
    • Setup .NET SDK via init.ps1
    • Setup NuGet 5.x
    • Restore NuGet packages
    • Setup MSBuild
    • Build solution with minimal verbosity and parallel builds
    • Generate StyleCop.Analyzers.Status.json
  • Artifacts:
    • NuGet packages (Release only): StyleCop.Analyzers.CodeFixes/bin/Release/*.nupkg
    • Status JSON (both configurations): StyleCop.Analyzers.Status.json
  • Security: Added explicit permissions: contents: read to limit GITHUB_TOKEN permissions

2. Updated README.md

  • Replaced AppVeyor build badge with GitHub Actions badge
  • Badge URL: https://github.com/AArnott/StyleCopAnalyzers/workflows/Build/badge.svg
  • Badge links to: https://github.com/AArnott/StyleCopAnalyzers/actions

3. Removed AppVeyor Configuration

  • Deleted appveyor.yml (preserved in git history)
  • Removed appveyor.yml reference from StyleCopAnalyzers.sln

4. Fixed GitHub Actions Compatibility

  • Updated build/Set-EnvVars.ps1 to use modern GitHub Actions environment file syntax
  • Replaced deprecated ::set-env with $env:GITHUB_ENV file writes
  • Replaced deprecated ::add-path with $env:GITHUB_PATH file writes

Notes:

  • VSIX artifact mentioned in old AppVeyor config was not included as the project no longer exists in the solution
  • CodeQL security scan passed with 0 alerts
  • Workflow follows GitHub Actions security best practices
  • Updated to use windows-latest runner image for latest Windows environment

Files Changed:

  • Added: .github/workflows/build.yml (62 lines)
  • Modified: README.md (1 line)
  • Modified: StyleCopAnalyzers.sln (1 line removed)
  • Modified: build/Set-EnvVars.ps1 (2 lines updated for GitHub Actions compatibility)
  • Deleted: appveyor.yml (25 lines)
Original prompt

Switch this repo from building with appveyor to building with github actions.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 16, 2025
Copilot AI and others added 4 commits November 16, 2025 01:51
Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Copilot AI changed the title [WIP] Switch build system from AppVeyor to GitHub Actions Migrate CI from AppVeyor to GitHub Actions Nov 16, 2025
Copilot AI requested a review from AArnott November 16, 2025 01:59
Comment thread .github/workflows/build.yml Resolved
Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Copilot AI requested a review from AArnott November 16, 2025 02:04
@AArnott

AArnott commented Nov 16, 2025

Copy link
Copy Markdown
Owner

@copilot The github actions workflow is failing with this error:

Error: Unable to process command '::set-env name=DOTNET_MULTILEVEL_LOOKUP::0' successfully.
Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

It appears this comes from the init.ps1 script.

Fix it.

Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>

Copilot AI commented Nov 16, 2025

Copy link
Copy Markdown
Author

@copilot The github actions workflow is failing with this error:

Fixed in commit b1989ba. Updated build/Set-EnvVars.ps1 to use the modern GitHub Actions environment file syntax ($env:GITHUB_ENV and $env:GITHUB_PATH) instead of the deprecated ::set-env and ::add-path commands.

@AArnott
AArnott force-pushed the copilot/switch-to-github-actions branch from e772d64 to e9c20ce Compare November 16, 2025 03:51
@AArnott
AArnott marked this pull request as ready for review November 16, 2025 03:52
Copilot AI review requested due to automatic review settings November 16, 2025 03:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR successfully migrates the StyleCopAnalyzers CI pipeline from AppVeyor to GitHub Actions. The migration updates the build configuration to use modern GitHub Actions syntax while maintaining the core build functionality.

  • Replaces AppVeyor CI with GitHub Actions workflow
  • Updates PowerShell scripts for GitHub Actions compatibility
  • Removes deprecated AppVeyor configuration files

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/build.yml New GitHub Actions workflow implementing matrix builds for Debug/Release configurations
build/Set-EnvVars.ps1 Updated to use modern GitHub Actions environment file syntax instead of deprecated commands
appveyor.yml Removed old AppVeyor configuration
StyleCopAnalyzers.sln Removed reference to deleted appveyor.yml file
README.md Updated CI badge from AppVeyor to GitHub Actions
.gitignore Added *.binlog to ignore MSBuild binary logs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build.yml Resolved
@AArnott
AArnott merged commit f3dfde2 into master Nov 16, 2025
@AArnott
AArnott deleted the copilot/switch-to-github-actions branch November 16, 2025 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants