KX-11806 - Create a GH test pipeline #26
This file contains 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
name: "CI: Build validation" | |
env: | |
working-directory: ./src | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "**.cs" | |
- "**.tsx" | |
- "**.js" | |
- "**.csproj" | |
- "**.props" | |
- "**.targets" | |
- "**.sln" | |
- "**/Client/**/*.json" | |
- "**/ci.yml" | |
pull_request: | |
branches: [main] | |
paths: | |
- "**.cs" | |
- "**.tsx" | |
- "**.js" | |
- "**.csproj" | |
- "**.props" | |
- "**.targets" | |
- "**.sln" | |
- "**/Client/**/*.json" | |
- "**/ci.yml" | |
jobs: | |
dotnet-format: | |
name: Code Style Validation | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: pwsh | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add dotnet-format problem matcher | |
uses: xt0rted/dotnet-format-problem-matcher@v1 | |
- name: Restore dotnet tools | |
uses: xt0rted/dotnet-tool-restore@v1 | |
- name: Run dotnet format | |
uses: xt0rted/dotnet-format@v1 | |
with: | |
only-changed-files: "true" | |
build-and-test: | |
name: Build and test | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: pwsh | |
working-directory: ${{ env.working-directory }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup NuGet | |
uses: NuGet/setup-nuget@v1.0.5 | |
- name: Setup VSTest | |
uses: darenm/Setup-VSTest@v1 | |
- name: Restore Packages | |
run: nuget restore WebApp.sln | |
- name: Build Solution | |
run: msbuild.exe WebApp.sln /p:platform="Any CPU" /p:configuration="Release" | |
- name: Test Solution | |
run: vstest.console.exe Kentico.Xperience.OpenAI.Azure.Tests\bin\Release\net48\Kentico.Xperience.OpenAI.Azure.Tests.dll | |