-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: use caching and split Build and Tests step #112
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1331356
use buildDebug
abeatrix bb1db05
run tests in parallel
abeatrix 7c0e967
BuildCodyAgentIfNeeded
abeatrix 8c4e1f3
use agentDir
abeatrix aa37ad4
use codyDir
abeatrix 895d666
wip
abeatrix 6c871ca
cache
abeatrix 73801b5
Merge branch 'main' into bee/cache-ci
abeatrix e70af49
clean up
abeatrix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,51 +2,78 @@ | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [main] | ||
pull_request: | ||
branches: [ main ] | ||
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: | ||
runs-on: windows-latest | ||
# 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/[email protected] | ||
|
||
- 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: Build Release | ||
run: | | ||
cd src | ||
dotnet tool restore | ||
corepack enable | ||
corepack install --global [email protected] | ||
dotnet cake | ||
|
||
- name: Tests | ||
env: | ||
Access_Token_UI_Tests: ${{ secrets.SRC_ACCESS_TOKEN_DOTCOM }} | ||
run: | | ||
cd src | ||
dotnet cake --target Tests | ||
dotnet test .\Cody.VisualStudio.Tests\bin\Debug\Cody.VisualStudio.Tests.dll -v detailed -l:trx | ||
|
||
- 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 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
|
||
- 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 [email protected] | ||
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.VisualStudio.Tests\bin\Debug\Cody.VisualStudio.Tests.dll -v detailed -l:trx | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PiotrKarczmarz @tomaszgolebiowski i noticed it's the Tests task that's usually take some time to start, but can't reproduce locally. Is this because of the infrastructure issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, this is because the CI infra is quite slow, and initial waiting time for registering extension and starting VS takes a lot of much time.