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-ts
7
+
8
+ on :
9
+ # Manual approval of forked environments is required
10
+ pull_request_target :
11
+ branches :
12
+ - main
13
+
14
+ concurrency :
15
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16
+ cancel-in-progress : true
17
+
18
+ permissions :
19
+ pull-requests : read
20
+ contents : read
21
+ id-token : write
22
+
23
+ env :
24
+ NODE_OPTIONS : --max_old_space_size=8192
25
+
26
+ jobs :
27
+ build_ts :
28
+ strategy :
29
+ fail-fast : false
30
+ matrix :
31
+ os : ["ubuntu-latest", "windows-latest", "macos-latest"]
32
+ version : [18, 20, 22]
33
+
34
+ runs-on : ${{ matrix.os }}
35
+ environment : development-forks
36
+ steps :
37
+ - if : runner.os == 'Linux'
38
+ run : |
39
+ sudo apt install libsecret-1-0
40
+ - name : Setup Git LF
41
+ run : |
42
+ git config --global core.autocrlf false
43
+ - uses : actions/checkout@v4
44
+ - uses : dorny/paths-filter@v3
45
+ id : filter
46
+ with :
47
+ filters : |
48
+ ts:
49
+ - "ts/**"
50
+ - ".github/workflows/build-ts.yml"
51
+ - uses : pnpm/action-setup@v4
52
+ if : ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
53
+ name : Install pnpm
54
+ with :
55
+ package_json_file : ts/package.json
56
+ - uses : actions/setup-node@v4
57
+ if : ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
58
+ with :
59
+ node-version : ${{ matrix.version }}
60
+ cache : " pnpm"
61
+ cache-dependency-path : ts/pnpm-lock.yaml
62
+ - name : Install dependencies
63
+ if : ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
64
+ working-directory : ts
65
+ run : |
66
+ pnpm install --frozen-lockfile --strict-peer-dependencies
67
+ - name : Install Playwright Browsers
68
+ if : ${{ runner.os == 'windows' && matrix.version == '22' }}
69
+ run : pnpm exec playwright install --with-deps
70
+ working-directory : ts/packages/shell
71
+ - name : Build
72
+ if : ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
73
+ working-directory : ts
74
+ run : |
75
+ npm run build
76
+ - name : Test
77
+ if : ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
78
+ working-directory : ts
79
+ run : |
80
+ npm run test:local
81
+ - name : Lint
82
+ if : ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
83
+ working-directory : ts
84
+ run : |
85
+ npm run lint
86
+ - name : Login to Azure
87
+ if : ${{ github.event_name != 'merge_group' }}
88
+
89
+ with :
90
+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_5B0D2D6BA40F4710B45721D2112356DD }}
91
+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_39BB903136F14B6EAD8F53A8AB78E3AA }}
92
+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F36C1F2C4B2C49CA8DD5C52FAB98FA30 }}
93
+ - name : Get Keys
94
+ if : ${{ github.event_name != 'merge_group' }}
95
+ run : |
96
+ node tools/scripts/getKeys.mjs --vault build-pipeline-kv
97
+ working-directory : ts
98
+ - name : Test CLI - smoke
99
+ if : ${{ github.event_name != 'merge_group' }}
100
+ run : |
101
+ npm run start:dev 'prompt' 'why is the sky blue'
102
+ working-directory : ts/packages/cli
103
+ continue-on-error : true
104
+ - name : Shell Tests - smoke (windows)
105
+ if : ${{ github.event_name != 'merge_group' && runner.os == 'windows' && matrix.version == '22' }}
106
+ timeout-minutes : 60
107
+ run : |
108
+ npx playwright test simple.spec.ts
109
+ rm ../../.env
110
+ - name : Shell Tests - smoke (linux)
111
+ if : ${{ github.event_name != 'merge_group' && runner.os == 'Linux' && matrix.version == '22' }}
112
+ timeout-minutes : 60
113
+ run : |
114
+ Xvfb :99 -screen 0 1600x1200x24 & export DISPLAY=:99
115
+ npx playwright test simple.spec.ts
116
+ rm ../../.env
117
+ working-directory : ts/packages/shell
118
+ continue-on-error : true
119
+ - name : Live Tests
120
+ if : ${{ github.event_name != 'merge_group' && runner.os == 'linux' && matrix.version == '22' }}
121
+ timeout-minutes : 60
122
+ run : |
123
+ npm run test:live
124
+ working-directory : ts
125
+ continue-on-error : true
0 commit comments