Skip to content

Try to fix multi project tests #768

Try to fix multi project tests

Try to fix multi project tests #768

Workflow file for this run

name: Build CodeConverter
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BuildVersion: '9.2.6'
jobs:
build:
runs-on: windows-2022
env:
BuildPlatform: Any CPU
BuildTarget: Release
steps:
- uses: actions/checkout@v4
- name: Update project version
uses: roryprimrose/[email protected]
with:
projectFilter: 'Directory.Build.props'
version: ${{ env.BuildVersion }}.${{ github.run_number }}
assemblyVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
fileVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
- name: Setup .NET for main build
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.0,)'
- name: Dotnet deterministic Build
run: dotnet build DotNetBuildable.slnf /p:Platform=$env:BuildPlatform /p:Configuration=$env:BuildTarget /p:ContinuousIntegrationBuild=true
- name: Dotnet Publish
run: dotnet publish DotNetPublishable.slnf /p:Platform=$env:BuildPlatform /p:Configuration=$env:BuildTarget
- name: MSBuild Vsix
run: msbuild Vsix\Vsix.csproj -restore /p:Configuration=$env:BuildTarget
- name: Execute unit tests
run: dotnet test $env:Tests1
env:
Tests1: Tests/bin/${{ env.BuildTarget }}/ICSharpCode.CodeConverter.Tests.dll
- name: Upload NuGet package
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.${{ env.BuildVersion }}.nupkg
path: CodeConverter/bin/${{ env.BuildTarget }}/ICSharpCode.CodeConverter.*.nupkg
- name: Upload VSIX
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.VsExtension.${{ env.BuildVersion }}.vsix
path: Vsix/bin/${{ env.BuildTarget }}/ICSharpCode.CodeConverter.VsExtension.vsix
- name: Upload Tool
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.CodeConv.${{ env.BuildVersion }}.nupkg
path: CommandLine/CodeConv/bin/${{ env.BuildTarget }}/ICSharpCode.CodeConverter.CodeConv.*.nupkg
- name: Upload Web
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.Web.${{ env.BuildVersion }}.zip
path: Web/bin/${{ env.BuildTarget }}/publish/
- name: Upload Function
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.Func.${{ env.BuildVersion }}.zip
path: Func/bin/${{ env.BuildTarget }}/publish/
deploy:
if: ${{ github.ref == 'refs/heads/master' }}
concurrency: ci-${{ github.ref }}
needs: [build] # The second job must depend on the first one to complete before running and uses ubuntu-latest instead of windows.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Download Artifacts 🔻 # The built project is downloaded into the 'site' folder.
uses: actions/download-artifact@v4
with:
name: ICSharpCode.CodeConverter.Web.${{ env.BuildVersion }}.zip
path: site
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: 'autoupdated/gh-pages'
folder: 'site/wwwroot'