-
Notifications
You must be signed in to change notification settings - Fork 634
133 lines (131 loc) · 5.05 KB
/
dynamo_bin_diff.yml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Runs on every pull request
#
# - Builds Dynamo current branch and master and performs a Bin Diff
# - Triggers Dynamo Post Build Bin Diff job on completion
name: Dynamo Bin Diff
on:
pull_request:
jobs:
build_current:
name: Build Current
runs-on: windows-latest
steps:
- name: Checkout Dynamo Repo
uses: actions/checkout@v4
with:
path: Dynamo
repository: DynamoDS/Dynamo
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Disable problem matcher
run: Write-Output "::remove-matcher owner=csc::"
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Install dependencies for windows runtime
run: |
dotnet restore ${{ github.workspace }}\Dynamo\src\Dynamo.All.sln /p:Configuration=Release --runtime=win-x64 -p:DotNet=net8.0
- name: Build Dynamo with MSBuild
run: |
Write-Output "***Continue with the build, Good luck developer!***"
msbuild ${{ github.workspace }}\Dynamo\src\Dynamo.All.sln /p:Configuration=Release /p:DotNet=net8.0
- name: Look for DynamoCLI.exe
run: |
Write-Output "***Locating DynamoCLI.exe!***"
if (Test-Path -Path "${{ github.workspace }}\Dynamo\bin\AnyCPU\Release\DynamoCLI.exe") {
Write-Output "DynamoCLI.exe exists!"
} else {
Write-Error "DynamoCLI.exe was not found!"
}
- name: Cache Current Build
uses: actions/cache/save@v4
with:
path: |
${{ github.workspace }}\Dynamo\bin\AnyCPU\Release
${{ github.workspace }}\Dynamo\.github\scripts
key: ${{ github.run_id }}-${{ github.run_attempt }}-current
build_master:
name: Build Master
runs-on: windows-latest
steps:
- name: Checkout Dynamo Repo
uses: actions/checkout@v4
with:
path: master
ref: master
repository: DynamoDS/Dynamo
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Disable problem matcher
run: Write-Output "::remove-matcher owner=csc::"
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Install dependencies for windows runtime
run: |
dotnet restore ${{ github.workspace }}\master\src\Dynamo.All.sln /p:Configuration=Release --runtime=win-x64 -p:DotNet=net8.0
- name: Build Dynamo with MSBuild
run: |
Write-Output "***Continue with the build, Good luck developer!***"
msbuild ${{ github.workspace }}\master\src\Dynamo.All.sln /p:Configuration=Release /p:DotNet=net8.0
- name: Look for DynamoCLI.exe
run: |
Write-Output "***Locating DynamoCLI.exe!***"
if (Test-Path -Path "${{ github.workspace }}\master\bin\AnyCPU\Release\DynamoCLI.exe") {
Write-Output "DynamoCLI.exe exists!"
} else {
Write-Error "DynamoCLI.exe was not found!"
}
- name: Cache Master Build
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}\master\bin\AnyCPU\Release
key: ${{ github.run_id }}-${{ github.run_attempt }}-master
bin_diff:
name: Binary Diff
needs: [build_current, build_master]
runs-on: windows-latest
steps:
- name: Restore Current Build
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
path: |
${{ github.workspace }}\Dynamo\bin\AnyCPU\Release
${{ github.workspace }}\Dynamo\.github\scripts
key: ${{ github.run_id }}-${{ github.run_attempt }}-current
- name: Restore Master Build
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
path: ${{ github.workspace }}\master\bin\AnyCPU\Release
key: ${{ github.run_id }}-${{ github.run_attempt }}-master
- name: Run Binary Diff Job
id: diff
run: |
Write-Output "***Running the binary diff job between the current branch and the master branch!***"
Set-Location -Path "${{ github.workspace }}\Dynamo\.github\scripts"
.\bin_diff.ps1 ${{ github.workspace }}\master\bin\AnyCPU\Release, ${{ github.workspace }}\Dynamo\bin\AnyCPU\Release -src ${{ github.job }}
Get-Content -Path result.txt | ? { $_ -ne "" } | Out-File -Path result.txt
- name: Upload Binary Diff Result
uses: actions/upload-artifact@v4
with:
name: bin_diff_result
path: ${{ github.workspace }}\Dynamo\.github\scripts\result.txt
save_pr_data:
name: Save PR Data
runs-on: ubuntu-latest
steps:
- name: Save PR Data
run: |
mkdir -p ${{ github.workspace }}/pr
echo ${{ github.event.number }} > ${{ github.workspace }}/pr/pr_number.txt
- name: Upload PR Data
uses: actions/upload-artifact@v4
with:
name: pr_data
path: ${{ github.workspace }}/pr
if-no-files-found: warn
retention-days: 3