|
| 1 | +name: CI Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - develop |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + - develop |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-and-test: |
| 15 | + runs-on: windows-2022 |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v3 |
| 19 | + |
| 20 | + - name: Setup .NET Core |
| 21 | + uses: actions/setup-dotnet@v2 |
| 22 | + with: |
| 23 | + dotnet-version: '8.x' |
| 24 | + |
| 25 | + - name: Restore dependencies |
| 26 | + run: dotnet restore Microsoft-Perf-Tools-Linux-Android.sln |
| 27 | + |
| 28 | + - name: Build projects |
| 29 | + run: | |
| 30 | + dotnet build CtfPlayback/CtfPlayback.csproj --configuration Release --no-restore |
| 31 | + dotnet build CtfUnitTest/CtfUnitTest.csproj --configuration Release --no-restore |
| 32 | + dotnet build LTTngCds/LTTngCds.csproj --configuration Release --no-restore |
| 33 | + dotnet build LTTngDataExtensions/LTTngDataExtensions.csproj --configuration Release --no-restore |
| 34 | + dotnet build LTTngDataExtUnitTest/LTTngDataExtUnitTest.csproj --configuration Release --no-restore |
| 35 | + dotnet build LTTngDriver/LTTngDriver.csproj --configuration Release --no-restore |
| 36 | + dotnet build PerfDataExtension/PerfDataExtension.csproj --configuration Release --no-restore |
| 37 | + dotnet build PerfDataUnitTest/PerfDataUnitTest.csproj --configuration Release --no-restore |
| 38 | + dotnet build PerfDataTxtExtension/PerfDataTxtExtension.csproj --configuration Release --no-restore |
| 39 | + dotnet build PerfettoCds/PerfettoCds.csproj --configuration Release --no-restore |
| 40 | + dotnet build PerfUnitTest/PerfUnitTest.csproj --configuration Release --no-restore |
| 41 | + dotnet build LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/Cloud-init/Cloud-Init.csproj --configuration Release --no-restore |
| 42 | + dotnet build LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/DmesgIsoLog/Dmesg.csproj --configuration Release --no-restore |
| 43 | + dotnet build LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/WaLinuxAgent/WaLinuxAgent.csproj --configuration Release --no-restore |
| 44 | + dotnet build LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/AndroidLogCat/AndroidLogcat.csproj --configuration Release --no-restore |
| 45 | + dotnet build LinuxLogParsers/LinuxLogParsersUnitTest/LinuxLogParsersUnitTest.csproj --configuration Release --no-restore |
| 46 | + |
| 47 | + - name: Test projects |
| 48 | + run: dotnet test Microsoft-Perf-Tools-Linux-Android.sln --no-restore --verbosity normal |
| 49 | + |
| 50 | + - name: Copy files and prepare artifacts |
| 51 | + run: | |
| 52 | + $dirs = @{ |
| 53 | + "PerfDataExtension" = "PerfDataExtension/bin/Release/netstandard2.1/*" |
| 54 | + "PerfDataTxtExtension" = "PerfDataTxtExtension/bin/Release/netstandard2.1/*" |
| 55 | + "LTTngDataExtensions" = "LTTngDataExtensions/bin/Release/netstandard2.1/*" |
| 56 | + "LTTngDriver" = "LTTngDriver/bin/Release/netcoreapp8.0/*" |
| 57 | + "Perfetto" = "PerfettoCds/bin/Release/netstandard2.1/*" |
| 58 | + "Cloud-init" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/Cloud-init/bin/Release/netstandard2.1/*" |
| 59 | + "Dmesg" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/DmesgIsoLog/bin/Release/netstandard2.1/*" |
| 60 | + "WaLinuxAgent" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/WaLinuxAgent/bin/Release/netstandard2.1/*" |
| 61 | + "AndroidLogCat" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/AndroidLogCat/bin/Release/netstandard2.1/*" |
| 62 | + "Launcher" = "Launcher/*" |
| 63 | + "ReleaseFiles" = "ReleaseFiles/*" |
| 64 | + } |
| 65 | + foreach ($dir in $dirs.Keys) { |
| 66 | + $sourcePath = $dirs[$dir] |
| 67 | + $targetPath = "${{ github.workspace }}/drop/Microsoft-Performance-Tools-Linux/MicrosoftPerfToolkitAddins/$dir" |
| 68 | + New-Item -ItemType Directory -Force -Path $targetPath |
| 69 | + Copy-Item $sourcePath -Destination $targetPath -Recurse |
| 70 | + } |
| 71 | + |
| 72 | + - name: Upload artifacts |
| 73 | + uses: actions/upload-artifact@v2 |
| 74 | + with: |
| 75 | + name: drop |
| 76 | + path: ${{ github.workspace }}/drop/ |
0 commit comments