Skip to content

Commit 592f18a

Browse files
authored
feat: GitHub actions for editor rewrite PRs (#2800)
1 parent 9113e83 commit 592f18a

4 files changed

Lines changed: 125 additions & 9 deletions

File tree

.github/pull_request_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@
2828
- [ ] I have added tests to cover my changes.
2929
- [ ] All new and existing tests passed.
3030
- [ ] **I have built and run the editor to try this change out.**
31+
32+
<!-- Consider opening a draft PR for initial review. -->
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Build Avalonia Editor
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/build-avalonia-editor.yml'
7+
- 'build/Stride.Editor.Avalonia.slnf'
8+
- 'sources/assets/**'
9+
- 'sources/core/**'
10+
- 'sources/editor/**'
11+
- 'sources/presentation/**'
12+
- 'sources/shared/**'
13+
- 'sources/targets/**'
14+
- '!**/.all-contributorsrc'
15+
- '!**/.editorconfig'
16+
- '!**/.gitignore'
17+
- '!**/*.md'
18+
- '!crowdin.yml'
19+
types: [opened, synchronize, reopened, ready_for_review]
20+
workflow_dispatch:
21+
inputs:
22+
build-type:
23+
description: Build Configuration
24+
default: Debug
25+
type: choice
26+
options:
27+
- Debug
28+
- Release
29+
platform:
30+
description: Platform
31+
default: Windows
32+
type: choice
33+
options:
34+
- Windows
35+
- Linux
36+
workflow_call:
37+
inputs:
38+
build-type:
39+
default: Debug
40+
type: string
41+
platform:
42+
default: Windows
43+
type: string
44+
45+
jobs:
46+
Setup:
47+
runs-on: ubuntu-latest
48+
outputs:
49+
build-type: ${{ steps.setup.outputs.build-type }}
50+
platform: ${{ steps.setup.outputs.platform }}
51+
steps:
52+
- id: setup
53+
run: |
54+
echo "build-type=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}" >> $GITHUB_OUTPUT
55+
echo "platform=${{ github.event.inputs.platform || inputs.platform || 'Windows' }}" >> $GITHUB_OUTPUT
56+
57+
#
58+
# Build Avalonia Editor on Linux
59+
#
60+
Linux:
61+
needs: Setup
62+
if: ${{ needs.Setup.outputs.platform == 'Linux' }}
63+
name: Linux (${{ needs.Setup.outputs.build-type }})
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
with:
68+
lfs: true
69+
- uses: actions/setup-dotnet@v4
70+
with:
71+
dotnet-version: '8.0.x'
72+
- name: Install dependencies
73+
run: |
74+
sudo apt-get install clang lld
75+
- name: Build
76+
run: |
77+
dotnet build build/Stride.Editor.Avalonia.slnf
78+
-m:1 -nr:false \
79+
-v:m -p:WarningLevel=0 \
80+
-p:Configuration=${{ needs.Setup.outputs.build-type }} \
81+
-p:StridePlatforms=Linux \
82+
-p:StrideGraphicsApis=OpenGL \
83+
-p:StrideSkipUnitTests=true \
84+
-p:StrideSkipAutoPack=true
85+
86+
#
87+
# Build Avalonia Editor on Windows
88+
#
89+
Windows:
90+
needs: Setup
91+
if: ${{ needs.Setup.outputs.platform == 'Windows' }}
92+
name: Windows (${{ needs.Setup.outputs.build-type }})
93+
runs-on: windows-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
with:
97+
lfs: true
98+
- uses: actions/setup-dotnet@v4
99+
with:
100+
dotnet-version: '8.0.x'
101+
- uses: microsoft/setup-msbuild@v2
102+
- name: Build
103+
run: |
104+
msbuild build\Stride.Editor.Avalonia.slnf `
105+
-restore -m:1 -nr:false `
106+
-v:m -p:WarningLevel=0 `
107+
-p:Configuration=${{ needs.Setup.outputs.build-type }} `
108+
-p:StridePlatforms=Windows `
109+
-p:StrideGraphicsApis=Direct3D11 `
110+
-p:StrideSkipUnitTests=true `
111+
-p:StrideSkipAutoPack=true

.github/workflows/build-linux-runtime.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,24 @@ jobs:
5050
Linux-Runtime:
5151
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event.pull_request.draft == false }}
5252
name: Build (${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}, ${{ github.event.inputs.graphics-api || inputs.graphics-api || 'OpenGL' }})
53-
runs-on: windows-latest
53+
runs-on: ubuntu-latest
5454
steps:
5555
- uses: actions/checkout@v4
5656
with:
5757
lfs: true
5858
- uses: actions/setup-dotnet@v4
5959
with:
6060
dotnet-version: '8.0.x'
61-
- uses: microsoft/setup-msbuild@v2
61+
- name: Install dependencies
62+
run: |
63+
sudo apt-get install clang lld
6264
- name: Build
6365
run: |
64-
msbuild build\Stride.Runtime.sln `
65-
-restore -m:1 -nr:false `
66-
-v:m -p:WarningLevel=0 `
67-
-p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} `
68-
-p:StridePlatforms=Linux `
69-
-p:StrideGraphicsApis=${{ github.event.inputs.graphics-api || inputs.graphics-api || 'OpenGL' }} `
70-
-p:StrideSkipUnitTests=true `
66+
dotnet build build/Stride.Runtime.sln \
67+
-m:1 -nr:false \
68+
-v:m -p:WarningLevel=0 \
69+
-p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} \
70+
-p:StridePlatforms=Linux \
71+
-p:StrideGraphicsApis=${{ github.event.inputs.graphics-api || inputs.graphics-api || 'OpenGL' }} \
72+
-p:StrideSkipUnitTests=true \
7173
-p:StrideSkipAutoPack=true

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- xplat-editor
78
paths:
89
- '.github/workflows/**'
910
- 'build/**'

0 commit comments

Comments
 (0)