Skip to content

Commit f3dfde2

Browse files
CopilotAArnott
andauthored
Migrate CI from AppVeyor to GitHub Actions (#2)
* Initial plan * Add GitHub Actions workflow and update README badge Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com> * Remove appveyor.yml and update solution file Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com> * Update GitHub Actions workflow to match actual project structure Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com> * Add explicit permissions to GitHub Actions workflow for security Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com> * Update to use windows-latest runner image Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com> * Fix deprecated GitHub Actions commands in Set-EnvVars.ps1 Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com> * Don't build in parallel, to avoid build breaks * Ignore .binlog files * Remove broken step that I don't know the purpose of --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com> Co-authored-by: Andrew Arnott <andrew.arnott@microsoft.com>
1 parent f5843ae commit f3dfde2

File tree

6 files changed

+55
-29
lines changed

6 files changed

+55
-29
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
tags-ignore: [ '**' ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
permissions:
14+
contents: read
15+
strategy:
16+
matrix:
17+
configuration: [Debug, Release]
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Configure git line endings
26+
run: git config --global core.autocrlf true
27+
28+
- name: Setup .NET SDK
29+
run: .\init.ps1 -NoRestore
30+
shell: pwsh
31+
32+
- name: Setup NuGet
33+
uses: nuget/setup-nuget@v2
34+
with:
35+
nuget-version: '5.x'
36+
37+
- name: Restore NuGet packages
38+
run: nuget restore StyleCopAnalyzers.sln
39+
40+
- name: Setup MSBuild
41+
uses: microsoft/setup-msbuild@v2
42+
43+
- name: Build solution
44+
run: msbuild StyleCopAnalyzers.sln /p:Configuration=${{ matrix.configuration }} /v:minimal
45+
46+
- name: Upload NuGet packages
47+
if: matrix.configuration == 'Release'
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: NuGet-Packages
51+
path: StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/bin/Release/*.nupkg

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ OpenCover.Symbols/
1414
.nuget/NuGet.exe
1515
build/nuget/
1616
*.log
17+
*.binlog
1718

1819
# Visual Studio performance tools
1920
*.psess

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![Join the chat at https://gitter.im/DotNetAnalyzers/StyleCopAnalyzers](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/DotNetAnalyzers/StyleCopAnalyzers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
66

7-
[![Build status](https://ci.appveyor.com/api/projects/status/8jw2lq431kgg44jl/branch/master?svg=true)](https://ci.appveyor.com/project/sharwell/stylecopanalyzers/branch/master)
7+
[![Build status](https://github.com/AArnott/StyleCopAnalyzers/workflows/Build/badge.svg)](https://github.com/AArnott/StyleCopAnalyzers/actions)
88

99
[![codecov.io](https://codecov.io/github/DotNetAnalyzers/StyleCopAnalyzers/coverage.svg?branch=master)](https://codecov.io/github/DotNetAnalyzers/StyleCopAnalyzers?branch=master)
1010

StyleCopAnalyzers.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1616
ProjectSection(SolutionItems) = preProject
1717
.codecov.yml = .codecov.yml
1818
.editorconfig = .editorconfig
19-
appveyor.yml = appveyor.yml
2019
CONTRIBUTING.md = CONTRIBUTING.md
2120
LICENSE = LICENSE
2221
README.md = README.md

appveyor.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

build/Set-EnvVars.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $Variables.GetEnumerator() |% {
4646
Write-Host "##vso[task.setvariable variable=$($_.Key);]$($_.Value)"
4747
}
4848
if ($env:GITHUB_ACTIONS) {
49-
Write-Host "::set-env name=$($_.Key)::$($_.Value)"
49+
Add-Content -Path $env:GITHUB_ENV -Value "$($_.Key)=$($_.Value)"
5050
}
5151

5252
if ($cmdInstructions) {
@@ -71,7 +71,7 @@ if ($PrependPath) {
7171
Write-Host "##vso[task.prependpath]$_"
7272
}
7373
if ($env:GITHUB_ACTIONS) {
74-
Write-Host "::add-path::$_"
74+
Add-Content -Path $env:GITHUB_PATH -Value "$_"
7575
}
7676
}
7777
}

0 commit comments

Comments
 (0)