-
Notifications
You must be signed in to change notification settings - Fork 32
114 lines (98 loc) · 5.67 KB
/
ci.yml
File metadata and controls
114 lines (98 loc) · 5.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI Build
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
build-and-test:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
6.x
8.x
- name: Restore dependencies
run: dotnet restore Microsoft-Perf-Tools-Linux-Android.sln
- name: Build projects
run: |
dotnet build CtfPlayback/CtfPlayback.csproj --configuration Release --no-restore
dotnet build CtfUnitTest/CtfUnitTest.csproj --configuration Release --no-restore
dotnet build LTTngCds/LTTngCds.csproj --configuration Release --no-restore
dotnet build LTTngDataExtensions/LTTngDataExtensions.csproj --configuration Release --no-restore
dotnet build LTTngDataExtUnitTest/LTTngDataExtUnitTest.csproj --configuration Release --no-restore
dotnet build LTTngDriver/LTTngDriver.csproj --configuration Release --no-restore
dotnet build PerfDataExtension/PerfDataExtension.csproj --configuration Release --no-restore
dotnet build PerfDataUnitTest/PerfDataUnitTest.csproj --configuration Release --no-restore
dotnet build PerfDataTxtExtension/PerfDataTxtExtension.csproj --configuration Release --no-restore
dotnet build PerfettoCds/PerfettoCds.csproj --configuration Release --no-restore
dotnet build PerfUnitTest/PerfUnitTest.csproj --configuration Release --no-restore
dotnet build LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/Cloud-init/Cloud-Init.csproj --configuration Release --no-restore
dotnet build LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/DmesgIsoLog/Dmesg.csproj --configuration Release --no-restore
dotnet build LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/WaLinuxAgent/WaLinuxAgent.csproj --configuration Release --no-restore
dotnet build LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/AndroidLogCat/AndroidLogcat.csproj --configuration Release --no-restore
dotnet build LinuxLogParsers/LinuxLogParsersUnitTest/LinuxLogParsersUnitTest.csproj --configuration Release --no-restore
- name: Test projects
run: dotnet test Microsoft-Perf-Tools-Linux-Android.sln --no-restore --verbosity normal
- name: Install PluginTool
run: dotnet tool install --global Microsoft.Performance.Toolkit.Plugins.Cli --version 0.1.25-preview
- name: Create PTIX
run: |
$dirs = @{
"PerfDataExtension" = "PerfDataExtension/bin/Release/netstandard2.1/"
"PerfDataTxtExtension" = "PerfDataTxtExtension/bin/Release/netstandard2.1/"
"LTTngDataExtensions" = "LTTngDataExtensions/bin/Release/netstandard2.1/"
"LTTngDriver" = "LTTngDriver/bin/Release/net8.0/"
"Perfetto" = "PerfettoCds/bin/Release/netstandard2.1/"
"Cloud-init" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/Cloud-init/bin/Release/netstandard2.1/"
"Dmesg" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/DmesgIsoLog/bin/Release/netstandard2.1/"
"WaLinuxAgent" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/WaLinuxAgent/bin/Release/netstandard2.1/"
"AndroidLogCat" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/AndroidLogCat/bin/Release/netstandard2.1/"
}
foreach ($plugin in $dirs.Keys) {
$sourcePath = $dirs[$plugin]
$targetPath = "${{ github.workspace }}/drop/Microsoft-Performance-Tools-Linux/MicrosoftPerfToolkitAddins/PTIX"
New-Item -ItemType Directory -Force -Path $targetPath
$pluginManifestPath = "$sourcePath/pluginManifest.json"
if (!(Test-Path $pluginManifestPath)) {
Write-Error "pluginManifest.json not found in $sourcePath"
}
$pluginManifest = Get-Content -Path $pluginManifestPath | ConvertFrom-Json
$pluginId = $pluginManifest.identity.id
$pluginVersion = $pluginManifest.identity.version
$packageName = "$pluginId-$pluginVersion.ptix"
plugintool pack -s $sourcePath -o "$targetPath/$packageName"
}
- name: Copy files and prepare artifacts
run: |
$dirs = @{
"PerfDataExtension" = "PerfDataExtension/bin/Release/netstandard2.1/*"
"PerfDataTxtExtension" = "PerfDataTxtExtension/bin/Release/netstandard2.1/*"
"LTTngDataExtensions" = "LTTngDataExtensions/bin/Release/netstandard2.1/*"
"LTTngDriver" = "LTTngDriver/bin/Release/net8.0/*"
"Perfetto" = "PerfettoCds/bin/Release/netstandard2.1/*"
"Cloud-init" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/Cloud-init/bin/Release/netstandard2.1/*"
"Dmesg" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/DmesgIsoLog/bin/Release/netstandard2.1/*"
"WaLinuxAgent" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/WaLinuxAgent/bin/Release/netstandard2.1/*"
"AndroidLogCat" = "LinuxLogParsers/LinuxPlugins-MicrosoftPerformanceToolkSDK/AndroidLogCat/bin/Release/netstandard2.1/*"
"Launcher" = "Launcher/*"
"ReleaseFiles" = "ReleaseFiles/*"
}
foreach ($dir in $dirs.Keys) {
$sourcePath = $dirs[$dir]
$targetPath = "${{ github.workspace }}/drop/Microsoft-Performance-Tools-Linux/MicrosoftPerfToolkitAddins/$dir"
New-Item -ItemType Directory -Force -Path $targetPath
Copy-Item $sourcePath -Destination $targetPath -Recurse
}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: drop
path: ${{ github.workspace }}/drop/