Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
elchananarb committed Jan 14, 2025
1 parent 032c739 commit 2dd025b
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@ permissions: write-all
jobs:
integration-tests:
runs-on: windows-2022

steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '6.0.x' # Use .NET 6.x

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '17.2'

- name: Install Visual Studio Build Tools
- name: Install Required Developer Packs
run: |
choco install netfx-4.0.3-devpack
choco install visualstudio2022buildtools
choco install visualstudio2022-workload-manageddesktop
choco install visualstudio2022-workload-visualstudioextension
Expand All @@ -35,9 +36,9 @@ jobs:
run: |
dotnet nuget locals all --clear
dotnet restore
nuget restore
- name: Prepare Test Project
shell: pwsh
run: |
$testProject = Get-ChildItem -Recurse -Filter "ast-visual-studio-extension-tests.csproj" | Select-Object -First 1
Expand All @@ -59,15 +60,15 @@ jobs:
run: |
msbuild /p:Configuration=Release /p:DeployExtension=False /p:VSSDKTargetPlatformRegRootSuffix=Exp /p:GenerateResourceUsePreserializedResources=true
- name: Run Tests
continue-on-error: true
- name: Run Tests with Coverage
shell: pwsh
run: |
$testProject = Get-ChildItem -Recurse -Filter "ast-visual-studio-extension-tests.csproj" | Select-Object -First 1
if ($testProject) {
Write-Host "Running tests for: $($testProject.FullName)"
Write-Host "Running tests with coverage for: $($testProject.FullName)"
dotnet test $testProject.FullName --configuration Release
dotnet test $testProject.FullName --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=./coverage/
} else {
Write-Error "Test project not found"
exit 1
Expand All @@ -78,4 +79,10 @@ jobs:
with:
name: test-results
path: |
**/*.trx
**/*.trx
- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: ./coverage/

0 comments on commit 2dd025b

Please sign in to comment.