Nightly Build #63
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
name: Nightly Build | |
on: | |
schedule: | |
- cron: "0 2 * * *" # Runs at 2 AM UTC every day | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: 16gb_16_core_large_window_runner | |
if: github.repository_owner == 'sourcegraph' | |
env: | |
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | |
Configuration: Debug | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add msbuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Cache nuget | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-nuget- | |
- name: Find the latest tag in Cody repository | |
uses: oprypin/[email protected] | |
id: cody | |
with: | |
repository: sourcegraph/cody | |
regex: 'vscode(-insiders)?-v\d+\.\d+\.\d+' | |
sort-tags: true | |
- name: Hash tag name | |
uses: pplanel/[email protected] | |
id: cody-hash | |
with: | |
input: ${{ steps.cody.outputs.tag }} | |
- name: Cache agent | |
id: cache-agent | |
uses: actions/cache@v4 | |
with: | |
path: src/Cody.VisualStudio/Agent | |
key: ${{ runner.os }}-agent-${{ steps.cody-hash.outputs.digest }} | |
- name: Build agent if needed (tag ${{ steps.cody.outputs.tag }}) | |
if: ${{ steps.cache-agent.outputs.cache-hit != 'true' }} | |
shell: pwsh | |
run: ./agent/buildAgent.ps1 -version ${{ steps.cody.outputs.tag }} | |
- name: Build extension (${{ env.Configuration }}) | |
run: msbuild src/Cody.sln -t:Build -restore -verbosity:minimal -property:Configuration=${{ env.Configuration }} | |
- name: Upload Cody.VisualStudio.vsix artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Cody.VisualStudio.vsix | |
path: src/Cody.VisualStudio/bin/${{ env.Configuration }}/Cody.VisualStudio.vsix | |
retention-days: 20 | |
#Running tests | |
- name: Change Screen Resolution | |
shell: pwsh | |
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force | |
- name: Run tests | |
env: | |
Access_Token_UI_Tests: ${{ secrets.SRC_ACCESS_TOKEN_DOTCOM }} | |
run: dotnet test src/*Tests/bin/${{ env.Configuration }}/*.Tests.dll --logger:trx --verbosity detailed | |
- name: Upload screenshots for UI tests | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: UI Tests Screenshots | |
path: src/Cody.VisualStudio.Tests/bin/${{ env.Configuration }}/Screenshots | |
retention-days: 20 | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action/windows@v2 | |
if: always() | |
with: | |
files: TestResults/**/*.trx |