-
Notifications
You must be signed in to change notification settings - Fork 101
91 lines (85 loc) · 3.46 KB
/
Copy pathbuild-dotnet.yml
File metadata and controls
91 lines (85 loc) · 3.46 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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# This workflow will build the TypeAgent TypeScript code.
name: build-dotnet
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
merge_group:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
pull-requests: read
contents: read
jobs:
build_dotnet:
strategy:
fail-fast: false
matrix:
configuration: ["Debug", "Release"]
runs-on: "windows-latest"
steps:
- name: Setup Git LF
run: |
git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
continue-on-error: true
with:
filters: |
dotnet:
- "dotnet/**"
- "ts/packages/agents/desktop/src/**Schema.ts"
- ".github/workflows/build-dotnet.yml"
- name: Setup MSBuild
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
uses: NuGet/setup-nuget@v2.0.0
- name: Install pnpm
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
uses: pnpm/action-setup@v4
with:
package_json_file: ts/package.json
- name: Setup Node.js
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: ts/pnpm-lock.yaml
- name: Install TS dependencies and generate schemas
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
working-directory: ts
run: |
pnpm install --frozen-lockfile --strict-peer-dependencies
pnpm run --filter @typeagent/action-schema-compiler... build
pnpm run -C packages/agents/desktop asc:all
- name: Restore Packages (AutoShell)
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
working-directory: dotnet
run: nuget restore autoShell/AutoShell.sln
- name: Build Solution (AutoShell)
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
working-directory: dotnet
run: |
msbuild.exe autoShell/AutoShell.sln /p:platform="Any CPU" /p:configuration="${{ matrix.configuration }}"
- name: Test AutoShell
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
working-directory: dotnet/autoShell.Tests
run: dotnet test --configuration ${{ matrix.configuration }}
- name: Restore Packages (TypeAgent)
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
working-directory: dotnet
run: nuget restore typeagent/TypeAgent.sln
- name: Build Solution (TypeAgent)
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
working-directory: dotnet
run: msbuild.exe typeagent/TypeAgent.sln /p:platform="Any CPU" /p:configuration="${{ matrix.configuration }}"