Skip to content

Commit

Permalink
Pipeline changes to build, publish, and test (#1400)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Legg <[email protected]>
  • Loading branch information
danlegg and dalegg authored Mar 29, 2024
1 parent e69ff22 commit 6dccf9e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
4 changes: 0 additions & 4 deletions .pipelines/OneBranch.Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ extends:
globalSdl:
tsa:
enabled: false

nugetPublishing:
feeds:
name: CppWinRT

stages:
- stage: build
Expand Down
15 changes: 8 additions & 7 deletions .pipelines/jobs/OneBranchNuGet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:

variables:
ob_outputDirectory: '$(Build.SourcesDirectory)\out'
ob_nugetPublishing_enabled: ${{ parameters.OfficialBuild }}
PackageVersion: ${{ parameters.BuildVersion }}

steps:
Expand Down Expand Up @@ -59,12 +58,8 @@ jobs:
- task: NuGetCommand@2
displayName: 'Build NuGet package'
inputs:
command: 'pack'
packagesToPack: 'nuget/Microsoft.Windows.CppWinRT.nuspec'
versioningScheme: byEnvVar
versionEnvVar: 'PackageVersion'
buildProperties: 'cppwinrt_exe=$(Build.SourcesDirectory)\x86\cppwinrt\cppwinrt.exe;cppwinrt_fast_fwd_x86=$(Build.SourcesDirectory)\x86\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_x64=$(Build.SourcesDirectory)\x64\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm=$(Build.SourcesDirectory)\arm\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm64=$(Build.SourcesDirectory)\arm64\cppwinrt_fast_forwarder.lib'
packDestination: $(ob_outputDirectory)\packages
command: 'custom'
arguments: 'pack nuget/Microsoft.Windows.CppWinRT.nuspec -NonInteractive -OutputDirectory $(ob_outputDirectory)\packages -Properties Configuration=release;cppwinrt_exe=$(Build.SourcesDirectory)\x86\cppwinrt\cppwinrt.exe;cppwinrt_fast_fwd_x86=$(Build.SourcesDirectory)\x86\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_x64=$(Build.SourcesDirectory)\x64\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm=$(Build.SourcesDirectory)\arm\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm64=$(Build.SourcesDirectory)\arm64\cppwinrt_fast_forwarder.lib;target_version=$(PackageVersion) -Version $(PackageVersion) -Verbosity Detailed'

- task: onebranch.pipeline.signing@1
displayName: '🔒 Onebranch Signing for NuGet package'
Expand All @@ -74,3 +69,9 @@ jobs:
signing_profile: external_distribution
files_to_sign: 'Microsoft.Windows.CppWinRT.*.nupkg'
search_root: $(ob_outputDirectory)\packages

- task: NuGetCommand@2
displayName: 'Publish NuGet package'
inputs:
command: 'custom'
arguments: 'push $(ob_outputDirectory)\packages\Microsoft.Windows.CppWinRT.$(PackageVersion).nupkg -NonInteractive -Source https://microsoft.pkgs.visualstudio.com/_packaging/CppWinRT/nuget/v3/index.json -ApiKey VSTS'
3 changes: 3 additions & 0 deletions .pipelines/jobs/OneBranchTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
- job:
pool:
type: windows
isCustom: true
name: 'Azure Pipelines'
vmImage: 'windows-2022' # (or 2019)
strategy:
matrix:
test.x86:
Expand Down
4 changes: 2 additions & 2 deletions .pipelines/jobs/OneBranchVsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ jobs:
inputs:
command: sign
signing_profile: external_distribution
files_to_sign: '**/Microsoft.Windows.CppWinRT.*.dll'
search_root: '$(Agent.TempDirectory)\$(VsixFilename)'
files_to_sign: '**\*.dll'
search_root: '$(Agent.TempDirectory)'

- task: ArchiveFiles@2
displayName: 'Repack signed VSIX contents'
Expand Down
9 changes: 9 additions & 0 deletions test/test_cpp20/format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,26 @@ TEST_CASE("format")
winrt::hstring str = L"World";
REQUIRE(std::format(L"Hello {}", str) == L"Hello World");
}
}

TEST_CASE("format_make")
{
{
winrt::Windows::Foundation::IStringable obj = winrt::make<stringable>();
REQUIRE(std::format(L"This is {}", obj) == L"This is a stringable object");
}
}

TEST_CASE("format_json")
{
{
winrt::Windows::Data::Json::JsonArray jsonArray;
REQUIRE(std::format(L"The contents of the array are: {}", jsonArray) == L"The contents of the array are: []");
}
}

TEST_CASE("format_wstring")
{
#if __cpp_lib_format >= 202207L
{
std::wstring str = L"World";
Expand Down

0 comments on commit 6dccf9e

Please sign in to comment.