microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
.github/workflows/build-dotnet.yml
91lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # Licensed under the MIT License. |
| 3 | |
| 4 | # This workflow will build the TypeAgent TypeScript code. |
| 5 | |
| 6 | name: build-dotnet |
| 7 | |
| 8 | on: |
| 9 | workflow_dispatch: |
| 10 | push: |
| 11 | branches: ["main"] |
| 12 | pull_request: |
| 13 | branches: ["main"] |
| 14 | merge_group: |
| 15 | branches: ["main"] |
| 16 | |
| 17 | concurrency: |
| 18 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 19 | cancel-in-progress: true |
| 20 | |
| 21 | permissions: |
| 22 | pull-requests: read |
| 23 | contents: read |
| 24 | |
| 25 | jobs: |
| 26 | build_dotnet: |
| 27 | strategy: |
| 28 | fail-fast: false |
| 29 | matrix: |
| 30 | configuration: ["Debug", "Release"] |
| 31 | runs-on: "windows-latest" |
| 32 | steps: |
| 33 | - name: Setup Git LF |
| 34 | run: | |
| 35 | git config --global core.autocrlf false |
| 36 | - uses: actions/checkout@v4 |
| 37 | - uses: dorny/paths-filter@v3 |
| 38 | id: filter |
| 39 | continue-on-error: true |
| 40 | with: |
| 41 | filters: | |
| 42 | dotnet: |
| 43 | - "dotnet/**" |
| 44 | - "ts/packages/agents/desktop/src/**Schema.ts" |
| 45 | - ".github/workflows/build-dotnet.yml" |
| 46 | - name: Setup MSBuild |
| 47 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 48 | uses: microsoft/setup-msbuild@v2 |
| 49 | - name: Setup NuGet |
| 50 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 51 | uses: NuGet/setup-nuget@v2.0.0 |
| 52 | - name: Install pnpm |
| 53 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 54 | uses: pnpm/action-setup@v4 |
| 55 | with: |
| 56 | package_json_file: ts/package.json |
| 57 | - name: Setup Node.js |
| 58 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 59 | uses: actions/setup-node@v4 |
| 60 | with: |
| 61 | node-version: 22 |
| 62 | cache: "pnpm" |
| 63 | cache-dependency-path: ts/pnpm-lock.yaml |
| 64 | - name: Install TS dependencies and generate schemas |
| 65 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 66 | working-directory: ts |
| 67 | run: | |
| 68 | pnpm install --frozen-lockfile --strict-peer-dependencies |
| 69 | pnpm run --filter @typeagent/action-schema-compiler... build |
| 70 | pnpm run -C packages/agents/desktop asc:all |
| 71 | - name: Restore Packages (AutoShell) |
| 72 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 73 | working-directory: dotnet |
| 74 | run: nuget restore autoShell/AutoShell.sln |
| 75 | - name: Build Solution (AutoShell) |
| 76 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 77 | working-directory: dotnet |
| 78 | run: | |
| 79 | msbuild.exe autoShell/AutoShell.sln /p:platform="Any CPU" /p:configuration="${{ matrix.configuration }}" |
| 80 | - name: Test AutoShell |
| 81 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 82 | working-directory: dotnet/autoShell.Tests |
| 83 | run: dotnet test --configuration ${{ matrix.configuration }} |
| 84 | - name: Restore Packages (TypeAgent) |
| 85 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 86 | working-directory: dotnet |
| 87 | run: nuget restore typeagent/TypeAgent.sln |
| 88 | - name: Build Solution (TypeAgent) |
| 89 | if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }} |
| 90 | working-directory: dotnet |
| 91 | run: msbuild.exe typeagent/TypeAgent.sln /p:platform="Any CPU" /p:configuration="${{ matrix.configuration }}" |
| 92 | |