-
Notifications
You must be signed in to change notification settings - Fork 10
91 lines (75 loc) · 2.75 KB
/
cake-build.yml
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
name: Cake Build
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
# concurrency prevents multiple instances of the workflow from running at the same time,
# using `cancel-in-progress` to cancel any existing runs.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
# this now uses a dedicated large runner from GitHub running the following specs:
# 8-core, 32GB RAM, 300GB SSD
# https://github.com/organizations/sourcegraph/settings/actions/runner-groups/6
runs-on: 16gb_16_core_large_window_runner
# do we want to run this on forks?
if: github.repository_owner == 'sourcegraph'
steps:
- uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3
- name: Change Screen Resolution
shell: pwsh
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
- name: ⚙️ Prepare Visual Studio
run: '&"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings'
- name: Install Cake.Tool
run: dotnet tool install --global Cake.Tool
- name: Restore NuGet packages
run: nuget restore src\Cody.Core\Cody.Core.csproj -PackagesDirectory src\packages
- name: Common Build Setup
run: |
cd src
dotnet tool restore
corepack enable
- name: Build Cody Agent if needed
run: |
cd src
corepack install --global pnpm@8.6.7
dotnet cake --target=BuildCodyAgentIfNeeded
- name: Cache cody-dist
uses: actions/cache@v3
with:
path: cody-dist/agent
key: ${{ runner.os }}-cody-dist-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cody-dist-
- name: Build Extension (Debug)
run: |
cd src
dotnet cake --target=BuildDebug
- name: Tests
env:
Access_Token_UI_Tests: ${{ secrets.SRC_ACCESS_TOKEN_DOTCOM }}
run: |
cd src
dotnet test .\Cody.Core.Tests\bin\Debug\Cody.Core.Tests.dll .\Cody.VisualStudio.Tests\bin\Debug\Cody.VisualStudio.Tests.dll -v detailed -l:trx
- name: Upload screenshots for UI tests
uses: actions/upload-artifact@v4
if: always()
with:
name: UI Tests Screenshots
path: src/Cody.VisualStudio.Tests/bin/Debug/Screenshots
retention-days: 20
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: |
src\TestResults/**/*.xml
src\TestResults/**/*.trx
src\TestResults/**/*.json