From 50df3eadc7090d140c8b7dfc7dbc038494e6ccc3 Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Wed, 5 Aug 2026 17:24:22 -0400 Subject: [PATCH] feat(vsix-build): add optional test-project input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Repos with a test project had to run tests in a separate workflow, which meant building the extension twice per PR — test projects reference the extension project, so `dotnet test` rebuilds it along with any self-contained server publish it triggers. Adding the test run to this job reuses the build output. SetVsixVersion is passed through to match the build step, since MSBuild would otherwise treat the differing global properties as a separate project instance and rebuild. The input defaults to empty, so repos that do not set it are unaffected. --- .github/workflows/vsix-build.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vsix-build.yml b/.github/workflows/vsix-build.yml index f69f582..21a7572 100644 --- a/.github/workflows/vsix-build.yml +++ b/.github/workflows/vsix-build.yml @@ -7,6 +7,11 @@ on: description: 'The extension name (e.g., BreakpointNotifier, OpenBinFolder)' required: true type: string + test-project: + description: 'Optional path to a test project or solution to run after the build. Tests are skipped when empty.' + required: false + type: string + default: '' secrets: HONEYCOMB_API_KEY: description: 'Honeycomb API key (optional, only used if HoneycombConfig.cs exists)' @@ -48,13 +53,20 @@ jobs: - name: 3. Build Project run: dotnet build ${{ env.PROJECT_PATH }} -c Release -p:SetVsixVersion=${{ steps.version.outputs.version }} - - name: 4. Create Information File + # Runs in the same job so the build above is reused. SetVsixVersion must match the build + # step exactly: MSBuild treats differing global properties as a different project instance + # and would rebuild the extension from scratch. + - name: 4. Run Tests + if: inputs.test-project != '' + run: dotnet test ${{ inputs.test-project }} -c Release -p:SetVsixVersion=${{ steps.version.outputs.version }} + + - name: 5. Create Information File uses: jsdaniell/create-json@v1.2.3 with: name: '${{ env.OUTPUT_PATH }}/${{ env.INFO_FILE }}' json: '{"sha":"${{ github.sha }}", "version":"${{ steps.version.outputs.version }}"}' - - name: 5. Upload Artifact + - name: 6. Upload Artifact uses: actions/upload-artifact@v4 with: path: |