# Repo: codefoco/AzureDevopsTemplates resources: repositories: - repository: templates type: github name: codefoco/AzureDevopsTemplates endpoint: codefoco stages: - stage: Build_Linux displayName: Build Linux jobs: - job: 'NLuaLinux' displayName: 'Linux' variables: - group: 'Keys' pool: vmImage: 'ubuntu-latest' demands: msbuild steps: - template: common-dotnet.yml@templates # - script: | # wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb # sudo dpkg -i packages-microsoft-prod.deb # rm packages-microsoft-prod.deb # displayName: 'Prepare to install .NET 6 SDK' # - script: | # sudo apt-get update; \ # sudo apt-get install -y apt-transport-https && \ # sudo apt-get update && \ # sudo apt-get install -y dotnet-sdk-6.0 # displayName: 'Install .NET 6 SDK' - checkout: self - task: DotNetCoreCLI@2 displayName: 'dotnet build NLua.net7.0.sln' inputs: command: custom custom: build arguments: '.\NLua.net7.0.sln /p:Configuration=Release' - task: DotNetCoreCLI@2 displayName: 'dotnet vstest' inputs: command: custom custom: vstest arguments: 'tests/build/net7.0/bin/Release/net7.0/NLuaTest.dll' - template: send-telegram.yml@templates - stage: Build_Mac displayName: 'Build Mac' jobs: - job: 'NLuaMac' displayName: 'Mac' variables: - group: 'Keys' pool: vmImage: 'macOS-12' demands: msbuild steps: - checkout: self - template: common-dotnet.yml@templates - template: common-macos.yml@templates - task: NuGetCommand@2 displayName: 'NuGet restore NLua.sln' inputs: restoreSolution: NLua.sln - task: NuGetCommand@2 displayName: 'NuGet restore NLua.Mac.sln' inputs: restoreSolution: NLua.Mac.sln - task: PowerShell@2 displayName: 'PowerShell Script' inputs: targetType: filePath filePath: ./devops/PreBuild.ps1 arguments: 'NLua' pwsh: true - task: MSBuild@1 displayName: 'Build solution NLua.sln' inputs: solution: NLua.sln configuration: Release - task: MSBuild@1 displayName: 'Build solution NLua.Mac.sln' inputs: solution: NLua.Mac.sln configuration: Release - script: 'nuget install NUnit.ConsoleRunner -Version 3.16.3 -source "https://api.nuget.org/v3/index.json" -OutputDirectory .' workingDirectory: ./ displayName: 'nuget install NUnit.ConsoleRunner' # reverted back to use NUnit.ConsoleRunner because Microsoft keeps breaking .NET - script: 'mono NUnit.ConsoleRunner.3.16.3/tools/nunit3-console.exe ./tests/build/net46/bin/Release/NLuaTest.dll' displayName: 'Run OSX tests' - script: 'mv TestResult.xml ./TEST-Result-Mac.xml' displayName: 'Rename Test result' - task: PublishTestResults@2 displayName: 'Publish Mac Test Results TEST-Result-Mac.xml' inputs: testResultsFormat: VSTest testResultsFiles: 'TEST-Result-Mac.xml' failTaskOnFailedTests: true - task: MSBuild@1 displayName: 'Run iOS tests' inputs: solution: tests/build/xamarinios/NLuaTest.XamariniOS.csproj platform: iPhoneSimulator configuration: Release msbuildArguments: '/t:RunSimulatorTests' - task: PublishTestResults@2 displayName: 'Publish iOS Test Results TEST-Result-iOS.xml' inputs: testResultsFormat: NUnit testResultsFiles: 'tests/build/xamarinios/TEST-Result-Xamarin.iOS.xml' failTaskOnFailedTests: true - task: MSBuild@1 displayName: 'Run tvOS tests' inputs: solution: tests/build/xamarintvos/NLuaTest.XamarinTVOS.csproj platform: iPhoneSimulator configuration: Release msbuildArguments: '/t:RunSimulatorTests' - task: PublishTestResults@2 displayName: 'Publish tvOS Test Results TEST-Result-tvOS.xml' inputs: testResultsFormat: NUnit testResultsFiles: 'tests/build/xamarintvos/TEST-Result-Xamarin.TVOS.xml' failTaskOnFailedTests: true - task: PublishPipelineArtifact@1 displayName: 'Publish Pipeline Artifact: TEST-Result-Xamarin.iOS.xml' inputs: targetPath: tests/build/xamarinios/TEST-Result-Xamarin.iOS.xml artifact: Test.Results.iOS publishLocation: 'pipeline' - task: PublishPipelineArtifact@1 displayName: 'Publish Pipeline Artifact: TEST-Result-Xamarin.tvOS.xml' inputs: targetPath: tests/build/xamarintvos/TEST-Result-Xamarin.TVOS.xml artifact: Test.Results.tvOS publishLocation: 'pipeline' - task: DotNetCoreCLI@2 displayName: 'dotnet build ./build/iOS/NLua.net7.0-ios.csproj' inputs: command: custom custom: build arguments: './build/iOS/NLua.net7.0-ios.csproj /p:Configuration=Release' - task: DotNetCoreCLI@2 displayName: 'dotnet build ./build/iOS/NLua.net7.0-maccatalyst.csproj' inputs: command: custom custom: build arguments: './build/iOS/NLua.net7.0-maccatalyst.csproj /p:Configuration=Release' - task: DotNetCoreCLI@2 displayName: 'dotnet build ./build/macOS/NLua.net7.0-macos.csproj' inputs: command: custom custom: build arguments: './build/macOS/NLua.net7.0-macos.csproj /p:Configuration=Release' - task: DotNetCoreCLI@2 displayName: 'dotnet build ./build/TVOS/NLua.net7.0-tvos.csproj' inputs: command: custom custom: build arguments: './build/TVOS/NLua.net7.0-tvos.csproj /p:Configuration=Release' - task: PublishPipelineArtifact@1 displayName: 'Publish Pipeline Artifact: libs.mac' inputs: targetPath: lib/Release/ artifact: 'libs.mac' publishLocation: 'pipeline' - template: send-telegram.yml@templates - stage: Build_Windows displayName: Build Windows dependsOn: ['Build_Mac'] jobs: - job: 'NLuaWindows' displayName: 'Windows' variables: - group: 'Keys' pool: vmImage: 'windows-2019' demands: - msbuild - visualstudio - vstest steps: - checkout: self - template: common-dotnet.yml@templates - template: common-win.yml@templates - task: NuGetCommand@2 displayName: 'NuGet restore' inputs: restoreSolution: NLua.sln - task: NuGetCommand@2 displayName: 'NuGet restore NLua.UWP' inputs: restoreSolution: NLua.UWP.sln - task: NuGetCommand@2 displayName: 'NuGet restore NLua.Android' inputs: restoreSolution: NLua.Android.sln - task: PowerShell@2 displayName: 'PreBuild Script' inputs: filePath: './devops/PreBuild.ps1' arguments: 'NLua' errorActionPreference: 'silentlyContinue' pwsh: true - task: MSBuild@1 displayName: 'Build solution NLua.sln' inputs: solution: 'NLua.sln' configuration: Release - task: MSBuild@1 displayName: 'Build Android' inputs: solution: 'NLua.Android.sln' configuration: Release - task: MSBuild@1 displayName: 'Build UWP' inputs: solution: 'NLua.UWP.sln' configuration: Release msbuildArguments: /restore - task: DotNetCoreCLI@2 displayName: 'dotnet build NLua.net7.0.sln' inputs: command: custom custom: build arguments: '.\NLua.net7.0.sln /p:Configuration=Release' - task: DotNetCoreCLI@2 displayName: 'dotnet build NLua.netstandard2.0.sln' inputs: command: custom custom: build arguments: '.\NLua.netstandard2.0.sln /p:Configuration=Release' - task: DotNetCoreCLI@2 displayName: 'dotnet build ./build/Android/NLua.net7.0-android.csproj' inputs: command: custom custom: build arguments: './build/Android/NLua.net7.0-android.csproj /p:Configuration=Release' - task: DotNetCoreCLI@2 displayName: 'dotnet vstest' inputs: command: custom custom: vstest arguments: '.\tests\build\net7.0\bin\Release\net7.0\NLuaTest.dll' - script: 'dotnet test .\tests\build\net46\bin\Release\NLuaTest.dll -l:trx --Platform:x64' displayName: 'Run Windows Tests' - script: 'RENAME TestResults\*.trx NLua.Windows.xml' displayName: 'Rename Test result' - script: 'MOVE TestResults\NLua.Windows.xml .' displayName: 'Move Test result' - task: PublishTestResults@2 inputs: testResultsFormat: 'VSTest' testResultsFiles: 'NLua.Windows.xml' failTaskOnFailedTests: true - task: PublishPipelineArtifact@1 displayName: 'Publish KeraLuaTest.Windows.xml' inputs: targetPath: NLua.Windows.xml artifact: 'NLua.Windows.xml' publishLocation: 'pipeline' - task: DownloadPipelineArtifact@2 displayName: 'Download Build libs.mac' inputs: buildType: 'current' artifactName: 'libs.mac' targetPath: './lib/Release/' - script: 'nuget setapikey $(apikey)' displayName: 'Set NuGet API Key' - task: PowerShell@2 displayName: 'Package NuGet' inputs: targetType: filePath filePath: ./devops/Package.ps1 arguments: 'NLua' pwsh: true - task: PublishBuildArtifacts@1 displayName: 'Save NLua.nupkg Artifact' inputs: PathtoPublish: NLua.nupkg ArtifactName: NLua.nupkg - task: PublishBuildArtifacts@1 displayName: 'Save NLua.snupkg Artifact' inputs: PathtoPublish: NLua.snupkg ArtifactName: NLua.snupkg - task: PowerShell@2 displayName: 'Publish NuGet' inputs: targetType: filePath filePath: ./devops/Publish.ps1 arguments: NLua pwsh: true - template: send-telegram.yml@templates