-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (63 loc) · 2.72 KB
/
main.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
name: CI
env:
config: Release
codeConnectionsSolution: CodeConnections.sln
vsix2019proj: CodeConnections\CodeConnections.Dev16.csproj
vsix2022proj: CodeConnections.Dev17\CodeConnections.Dev17.csproj
vs2019testsproj: CodeConnections.Tests\CodeConnections.Tests.csproj
vsix2019Container: ${{ github.workspace }}\CodeConnections_2019.vsix
vsix2022Container: ${{ github.workspace }}\CodeConnections_2022.vsix
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches:
- main
- 'release/**'
pull_request:
branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build the VSIX and upload as an artifact, and run tests
build:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 1000 # Needed for NB.GV - https://github.com/dotnet/Nerdbank.GitVersioning/issues/423
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
- name: Add VSTest to PATH
uses: darenm/Setup-VSTest@v1
- name: Restore NuGet packages
run: nuget restore ${{ env.codeConnectionsSolution }}
- name: Build VS2019 VSIX
run: |
msbuild ${{ env.vsix2019proj }} /p:configuration=${{ env.config }} /p:TargetVsixContainer=${{ env.vsix2019Container }} /p:DeployExtension=false /verbosity:minimal
- name: Build VS2022 VSIX
run: |
msbuild ${{ env.vsix2022proj }} /p:configuration=${{ env.config }} /p:TargetVsixContainer=${{ env.vsix2022Container }} /p:DeployExtension=false /verbosity:minimal
- name: Build VS2019 unit tests
run: |
msbuild ${{ env.vs2019testsproj }} /p:configuration=${{ env.config }} /verbosity:minimal
- name: Upload VS2019 VSIX Artifact
uses: actions/upload-artifact@v2
with:
# Artifact name
name: 'CodeConnections_VSIX_VS2019'
# A file, directory or wildcard pattern that describes what to upload
path: ${{ env.vsix2019Container }}
- name: Upload VS2022 VSIX Artifact
uses: actions/upload-artifact@v2
with:
# Artifact name
name: 'CodeConnections_VSIX_VS2022'
# A file, directory or wildcard pattern that describes what to upload
path: ${{ env.vsix2022Container }}
- name: Unit tests
run: vstest.console.exe .\CodeConnections.Tests\bin\${{ env.config }}\CodeConnections.Tests.dll