|
| 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 |
0 commit comments