Skip to content

add ui tests to pipeline #693

add ui tests to pipeline

add ui tests to pipeline #693

Workflow file for this run

name: Checkmarx One visual studio extension CI
on: [ pull_request, workflow_dispatch ]
permissions: write-all
jobs:
integration-tests:
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Fetch Sources
uses: actions/checkout@v4
- name: Setup VSTest
uses: darenm/Setup-VSTest@3a16d909a1f3bbc65b52f8270d475d905e7d3e44 #v1
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c #v1.3.1
with:
vs-version: '17.2'
- name: Restore NuGet packages
run: nuget restore .
- name: Restore
run: dotnet restore .
- name: Build
run: msbuild /p:Configuration=Release /p:DeployExtension=False
- name: Tests
env:
CX_APIKEY: ${{ secrets.CX_APIKEY }}
run: vstest.console.exe /InIsolation .\ast-visual-studio-extension-tests\bin\Release\net60-windows\ast-visual-studio-extension-tests.dll
UI-tests:
runs-on: windows-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Visual Studio
- name: Set up Visual Studio
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
# Step 3: Restore dependencies
- name: Restore NuGet packages
run: nuget restore
# Step 4: Build the solution
- name: Build solution
run: msbuild ast-visual-studio-extension.sln /p:Configuration=Release
# Step 7: Install Checkmarx Extension
- name: Install Checkmarx Extension
run: |
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VSIXInstaller.exe" /quiet "D:\a\ast-visual-studio-extension\ast-visual-studio-extension\ast-visual-studio-extension\bin\Release\ast-visual-studio-extension.vsix"
Start-Sleep -Seconds 20
# Step 8: Run UI Tests
- name: Run UI Tests
run: |
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" /InIsolation .\UITests\bin\Release\UITests.dll
continue-on-error: true
- name: Upload Descendants File
uses: actions/upload-artifact@v4
with:
name: screenshot
path: ${{ github.workspace }}\Screenshots