|
| 1 | +name: Build and Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, develop] |
| 6 | + paths: |
| 7 | + - src/** |
| 8 | + - tests/** |
| 9 | + - build/** |
| 10 | + - build.ps1 |
| 11 | + - build.sh |
| 12 | + - '*.sln' |
| 13 | + - Directory.Build.props |
| 14 | + - Directory.Packages.props |
| 15 | + - GitVersion.yml |
| 16 | + - .github/workflows/build.yml |
| 17 | + pull_request: |
| 18 | + branches: [main, develop] |
| 19 | + paths: |
| 20 | + - src/** |
| 21 | + - tests/** |
| 22 | + - build/** |
| 23 | + - build.ps1 |
| 24 | + - build.sh |
| 25 | + - '*.sln' |
| 26 | + - Directory.Build.props |
| 27 | + - Directory.Packages.props |
| 28 | + - GitVersion.yml |
| 29 | + - .github/workflows/build.yml |
| 30 | + |
| 31 | +jobs: |
| 32 | + build-test: |
| 33 | + name: Build & Test |
| 34 | + runs-on: windows-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + fetch-depth: 0 |
| 39 | + |
| 40 | + - name: Setup .NET |
| 41 | + uses: actions/setup-dotnet@v4 |
| 42 | + with: |
| 43 | + global-json-file: global.json |
| 44 | + |
| 45 | + - name: Compile |
| 46 | + run: ./build.ps1 Compile --configuration Release |
| 47 | + shell: pwsh |
| 48 | + |
| 49 | + - name: Test |
| 50 | + run: ./build.ps1 Test --configuration Release |
| 51 | + shell: pwsh |
| 52 | + |
| 53 | + - name: Upload test results |
| 54 | + if: always() |
| 55 | + uses: actions/upload-artifact@v4 |
| 56 | + with: |
| 57 | + name: test-results |
| 58 | + path: TestResults/**/*.trx |
| 59 | + if-no-files-found: ignore |
| 60 | + |
| 61 | + validate: |
| 62 | + name: Validate |
| 63 | + runs-on: windows-latest |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v4 |
| 66 | + |
| 67 | + - name: Setup .NET |
| 68 | + uses: actions/setup-dotnet@v4 |
| 69 | + with: |
| 70 | + global-json-file: global.json |
| 71 | + |
| 72 | + - name: Validate Config |
| 73 | + run: ./build.ps1 ValidateConfig |
| 74 | + shell: pwsh |
| 75 | + |
| 76 | + - name: Validate Traceability |
| 77 | + run: ./build.ps1 ValidateTraceability |
| 78 | + shell: pwsh |
| 79 | + |
| 80 | + package: |
| 81 | + name: Package |
| 82 | + needs: build-test |
| 83 | + runs-on: windows-latest |
| 84 | + steps: |
| 85 | + - uses: actions/checkout@v4 |
| 86 | + with: |
| 87 | + fetch-depth: 0 |
| 88 | + |
| 89 | + - name: Setup .NET |
| 90 | + uses: actions/setup-dotnet@v4 |
| 91 | + with: |
| 92 | + global-json-file: global.json |
| 93 | + |
| 94 | + - name: Pack NuGet |
| 95 | + run: ./build.ps1 PackNuGet --configuration Release |
| 96 | + shell: pwsh |
| 97 | + |
| 98 | + - name: Pack REPL Tool |
| 99 | + run: ./build.ps1 PackReplTool --configuration Release |
| 100 | + shell: pwsh |
| 101 | + |
| 102 | + - name: Upload NuGet packages |
| 103 | + uses: actions/upload-artifact@v4 |
| 104 | + with: |
| 105 | + name: nuget-packages |
| 106 | + path: artifacts/nupkg/*.nupkg |
| 107 | + |
| 108 | + - name: Upload REPL tool package |
| 109 | + uses: actions/upload-artifact@v4 |
| 110 | + with: |
| 111 | + name: repl-tool-package |
| 112 | + path: local-packages/*.nupkg |
| 113 | + |
| 114 | + msix: |
| 115 | + name: MSIX Package |
| 116 | + needs: build-test |
| 117 | + runs-on: windows-latest |
| 118 | + continue-on-error: true |
| 119 | + steps: |
| 120 | + - uses: actions/checkout@v4 |
| 121 | + with: |
| 122 | + fetch-depth: 0 |
| 123 | + |
| 124 | + - name: Setup .NET |
| 125 | + uses: actions/setup-dotnet@v4 |
| 126 | + with: |
| 127 | + global-json-file: global.json |
| 128 | + |
| 129 | + - name: Package MSIX |
| 130 | + run: ./build.ps1 PackageMsix --configuration Release |
| 131 | + shell: pwsh |
| 132 | + |
| 133 | + - name: Upload MSIX artifact |
| 134 | + if: success() |
| 135 | + uses: actions/upload-artifact@v4 |
| 136 | + with: |
| 137 | + name: msix-package |
| 138 | + path: artifacts/msix/*.msix |
| 139 | + |
| 140 | + publish: |
| 141 | + name: Publish |
| 142 | + needs: build-test |
| 143 | + if: github.event_name == 'push' |
| 144 | + runs-on: windows-latest |
| 145 | + steps: |
| 146 | + - uses: actions/checkout@v4 |
| 147 | + with: |
| 148 | + fetch-depth: 0 |
| 149 | + |
| 150 | + - name: Setup .NET |
| 151 | + uses: actions/setup-dotnet@v4 |
| 152 | + with: |
| 153 | + global-json-file: global.json |
| 154 | + |
| 155 | + - name: Publish Server |
| 156 | + run: ./build.ps1 Publish --configuration Release |
| 157 | + shell: pwsh |
| 158 | + |
| 159 | + - name: Upload publish artifact |
| 160 | + uses: actions/upload-artifact@v4 |
| 161 | + with: |
| 162 | + name: mcp-server-publish |
| 163 | + path: artifacts/mcp-server/ |
0 commit comments