From cf03d0cca1730a80abd75692a13224020771afd7 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Sun, 26 May 2024 21:33:30 +0200 Subject: [PATCH] (#55) Test: use correct package location on macOS --- .github/workflows/main.yml | 4 ++-- github-actions.fsx | 30 ++++++++++++++++++------------ macos/Test-Dependencies.ps1 | 4 +++- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 547b925..74adba0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -271,7 +271,7 @@ jobs: path: build/tdlib.native.osx-arm64/runtimes/osx-arm64/native - name: Verify library dependencies shell: pwsh - run: ./macos/Test-Dependencies.ps1 -DotNetArch arm64 + run: ./macos/Test-Dependencies.ps1 -DotNetArch arm64 -PackageName tdlib.native.osx-arm64 - name: Set up .NET SDK uses: actions/setup-dotnet@v4 with: @@ -308,7 +308,7 @@ jobs: path: build/tdlib.native.osx-x64/runtimes/osx-x64/native - name: Verify library dependencies shell: pwsh - run: ./macos/Test-Dependencies.ps1 -DotNetArch x64 + run: ./macos/Test-Dependencies.ps1 -DotNetArch x64 -PackageName tdlib.native.osx-x64 - name: Set up .NET SDK uses: actions/setup-dotnet@v4 with: diff --git a/github-actions.fsx b/github-actions.fsx index b127266..881cd23 100644 --- a/github-actions.fsx +++ b/github-actions.fsx @@ -241,6 +241,13 @@ let workflows = [ $"Set-Location {dir} && zip -r $env:GITHUB_WORKSPACE/{Names.ciArtifact platform arch}.zip *" ] + let testLinuxDependencies platform arch = + pwsh "Verify library dependencies" ( + "./linux/Test-Dependencies.ps1" + + $" -Platform {platform}" + + $" -PackageName {Names.package platform arch}" + ) + Workflows.TestJob( image = ubuntu20_04, platform = Platform.Ubuntu20_04, @@ -248,11 +255,7 @@ let workflows = [ installScript = "./linux/install.ps1 -ForTests", testArgs = "-NuGet $env:GITHUB_WORKSPACE/tools/nuget.exe -UseMono", afterDownloadSteps = [ - pwsh "Verify library dependencies" ( - "./linux/Test-Dependencies.ps1" + - $" -Platform {Platform.Ubuntu20_04}" + - $" -PackageName {Names.package Platform.Ubuntu20_04 Arch.X86_64}" - ) + testLinuxDependencies Platform.Ubuntu20_04 Arch.X86_64 ] ) @@ -263,21 +266,24 @@ let workflows = [ installScript = "./linux/install.ps1 -ForTests", testArgs = "-NuGet $env:GITHUB_WORKSPACE/tools/nuget.exe -UseMono", afterDownloadSteps = [ - pwsh "Verify library dependencies" ( - "./linux/Test-Dependencies.ps1" + - $" -Platform {Platform.Ubuntu22_04}" + - $" -PackageName {Names.package Platform.Ubuntu22_04 Arch.X86_64}" - ) + testLinuxDependencies Platform.Ubuntu22_04 Arch.X86_64 ] ) + let testMacOsDependencies platform arch = + pwsh "Verify library dependencies" ( + "./macos/Test-Dependencies.ps1" + + $" -DotNetArch {Names.archToDotNet arch}" + + $" -PackageName {Names.package platform arch}" + ) + Workflows.TestJob( image = macOs14, platform = Platform.MacOS, arch = Arch.AArch64, testArgs = "-NuGet nuget", afterDownloadSteps = [ - pwsh "Verify library dependencies" $"./macos/Test-Dependencies.ps1 -DotNetArch {Names.archToDotNet Arch.AArch64}" + testMacOsDependencies Platform.MacOS Arch.AArch64 ] ) @@ -287,7 +293,7 @@ let workflows = [ arch = Arch.X86_64, testArgs = "-NuGet nuget", afterDownloadSteps = [ - pwsh "Verify library dependencies" $"./macos/Test-Dependencies.ps1 -DotNetArch {Names.archToDotNet Arch.X86_64}" + testMacOsDependencies Platform.MacOS Arch.X86_64 ] ) diff --git a/macos/Test-Dependencies.ps1 b/macos/Test-Dependencies.ps1 index c5f3d4d..e20adba 100644 --- a/macos/Test-Dependencies.ps1 +++ b/macos/Test-Dependencies.ps1 @@ -1,8 +1,10 @@ param ( [Parameter(Mandatory = $true)] [string] $DotNetArch, + [Parameter(Mandatory = $true)] + [string] $PackageName, [string] $RepoRoot = "$PSScriptRoot/..", - [string] $Package = "$RepoRoot/build/runtimes/macos-$DotNetArch/native", + [string] $Package = "$RepoRoot/build/$PackageName/runtimes/macos-$DotNetArch/native", [string] $GoldFile = "$RepoRoot/macos/libraries.$DotNetArch.gold.txt", [string] $ResultFile = "$RepoRoot/macos/libraries.temp.txt", [string] $LddApple = "$RepoRoot/ldd-apple/ldd-apple.sh",