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: |