-
-
Notifications
You must be signed in to change notification settings - Fork 60
182 lines (151 loc) · 6.09 KB
/
Copy pathbuild.yml
File metadata and controls
182 lines (151 loc) · 6.09 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: "Build Unity SDK"
on:
workflow_call:
inputs:
unity-version:
required: true
type: string
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
GITHUB_ACTOR: ${{ github.actor }}
UNITY_VERSION: ${{ inputs.unity-version }}
defaults:
run:
shell: pwsh
jobs:
build:
name: Build - ${{ inputs.unity-version }}
runs-on: ubuntu-22.04
permissions:
actions: read
checks: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@f68fdb76e2ea636224182cfb7377ff9a1708f9b8 # v1.3.0
with:
android: true
dotnet: false
haskell: true
large-packages: false
docker-images: false
swap-storage: true
- name: Checkout submodules
run: git submodule update --init --recursive src/sentry-dotnet
- name: Load env
id: env
run: |
$v = (Get-Content scripts/unity-versions.json -Raw | ConvertFrom-Json).'${{ env.UNITY_VERSION }}'.version
"unityVersion=$v" >> $env:GITHUB_OUTPUT
- name: Cache Unity Library
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/unity-of-bugs/Library
key: Library-unity-of-bugs-${{ steps.env.outputs.unityVersion }}-v1
restore-keys: |
Library-unity-of-bugs-${{ steps.env.outputs.unityVersion }}-
- name: Docker Login
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ghcr.io
username: ${{ env.GITHUB_ACTOR }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Start the Unity docker container
run: ./scripts/ci-docker.sh "$UNITY_VERSION" 'ios' "$UNITY_LICENSE_SERVER_CONFIG"
shell: bash
env:
UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}
- name: Install .NET SDK
if: runner.os != 'Windows'
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
global-json-file: global.json
- name: Restore .NET Workload
run: dotnet workload restore
- name: Download CLI
run: ./scripts/download-sentry-cli.ps1
- name: Download Android SDK
uses: ./.github/actions/wait-for-artifact
with:
name: Android-sdk
path: package-dev/Plugins/Android
- name: Download Cocoa SDK
uses: ./.github/actions/wait-for-artifact
with:
name: Cocoa-sdk
path: package-dev/Plugins
- name: Download MacOSNative SDK
uses: ./.github/actions/wait-for-artifact
with:
name: MacOSNative-sdk
path: package-dev/Plugins/macOS/SentryNative~
- name: Download Linux SDK
uses: ./.github/actions/wait-for-artifact
with:
name: Linux-sdk
path: package-dev/Plugins/Linux/Sentry~
- name: Download LinuxNative SDK
uses: ./.github/actions/wait-for-artifact
with:
name: LinuxNative-sdk
path: package-dev/Plugins/Linux/SentryNative~
- name: Download Windows SDK
uses: ./.github/actions/wait-for-artifact
with:
name: Windows-sdk
path: package-dev/Plugins/Windows/Sentry~
- name: Download WindowsNative SDK
uses: ./.github/actions/wait-for-artifact
with:
name: WindowsNative-sdk
path: package-dev/Plugins/Windows/SentryNative~
- name: Build Sentry.Unity Solution
run: docker exec unity dotnet build -c Release -v:d
- name: Install assemblyalias
run: docker exec unity dotnet tool install --global Sentry.AssemblyAlias --version 0.5.0 --allow-roll-forward
- name: Alias assemblies
run: docker exec unity pwsh scripts/alias-assemblies.ps1 -AssemblyAlias /home/gh/.dotnet/tools/assemblyalias
- name: Package for release
run: |
docker exec unity dotnet msbuild /t:UnityConfigureSentryOptions /p:Configuration=Release /p:OutDir=other src/Sentry.Unity
./scripts/pack.ps1
- name: Upload release artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: package-release
if-no-files-found: error
path: |
package-release.zip
- name: Build DependencyConflict package
run: docker exec unity dotnet build test/Scripts.Integration.Test/DependencyConflictPackage
- name: Upload DependencyConflict package
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dependency-conflict-package
if-no-files-found: error
path: test/Scripts.Integration.Test/DependencyConflictPackage/DependencyConflict
- name: Run Unity tests (playmode)
run: docker exec unity dotnet msbuild /t:UnityPlayModeTest /p:Configuration=Release /p:OutDir=other test/Sentry.Unity.Tests
- name: Run Unity tests (editmode)
run: docker exec unity dotnet msbuild /t:UnityEditModeTest /p:Configuration=Release /p:OutDir=other test/Sentry.Unity.Editor.Tests
- name: Publish Test Results
uses: dorny/test-reporter@a6ddd83ac95ff4586f5d3aceeb314d9a1841db95 # v3.0.0
if: ${{ !cancelled() }}
with:
name: Unity Test Results - ${{ env.UNITY_VERSION }}
path: artifacts/test/**/*.xml
reporter: dotnet-nunit
fail-on-error: false
- name: Upload test artifacts (playmode)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Test results (playmode) - ${{ env.UNITY_VERSION }}
path: artifacts/test/playmode
- name: Upload test artifacts (editmode)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Test results (editmode) - ${{ env.UNITY_VERSION }}
path: artifacts/test/editmode