Skip to content

Commit

Permalink
Merge pull request #173 from tonyhallett/github-actions
Browse files Browse the repository at this point in the history
move from appveyor to github actions
  • Loading branch information
tonyhallett authored Aug 17, 2021
2 parents 7a19921 + d9aa33b commit 9f6730e
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 17 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/addVsixLinkToIssues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Add vsix link comment to issues
on:
workflow_run:
workflows: [Push vsix artifact pull release and comment]
types: [completed]


jobs:
vsix-comments:
if: github.event.workflow_run.conclusion=='success' && github.event.workflow_run.event=='pull_request'
name: Add vsix link comment to issues
runs-on: windows-2019
steps:
- name: Add vsix link comment to issues
uses: tonyhallett/artifacts-url-comments@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prefix: Please try
suffix: Does this resolve your issue ?
format: name
addTo: pullandissues



103 changes: 103 additions & 0 deletions .github/workflows/push_pull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Push vsix artifact pull release and comment
on:
push:
branches:
- master
pull_request:
branches:
- master
types: [opened, synchronize, edited]
env:
CONFIGURATION: Release
VSIX_PROJECT: FineCodeCoverage
jobs:
push-vsix-artifact-pull-release-and-comment:
name: Push vsix artifact pull release and comment
runs-on: windows-2019
steps:
- name: create variables
shell: bash
run: |
echo "SOLN=${{env.VSIX_PROJECT}}.sln" >> $GITHUB_ENV
echo "VSIX=${{github.workspace}}\${{env.VSIX_PROJECT}}\bin\${{env.CONFIGURATION}}\${{env.VSIX_PROJECT}}.vsix" >> $GITHUB_ENV # full path required for vsix publish
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Determine next version
id: next-version
uses: paulhatch/semantic-version@v4.0.1
with:
short_tags: false
branch: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'HEAD' }}

- name: set up msbuild
uses: microsoft/setup-msbuild@v1.0.2

- name: set up VSTest
uses: darenm/Setup-VSTest@v1

- name: nuget restore
run: nuget restore ${{env.SOLN}}

- name: Set version for Visual Studio Extension
uses: cezarypiatek/VsixVersionAction@1.0
with:
version: ${{steps.next-version.outputs.major}}.${{steps.next-version.outputs.minor}}.${{github.run_number}}.${{steps.next-version.outputs.patch}}
vsix-manifest-file: ${{env.VSIX_PROJECT}}\source.extension.vsixmanifest

- name: build vsix
run: |
msbuild ${{env.SOLN}} /p:Configuration=${{env.CONFIGURATION}} /p:DeployExtension=False /verbosity:minimal
- name: vs test solution
uses: tonyhallett/vstest-solution-action@v1.0.0

# above are common steps for push and pull

# pull only
- name: upload vsix
if: github.event_name == 'pull_request' && !github.event.pull_request.draft
uses: actions/upload-artifact@v2
with:
name: FineCodeCoverage ( zipped vsix)
path: ${{env.VSIX}}

# push only
- name: create release
if: github.event_name == 'push'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.next-version.outputs.version_tag}}
release_name: ${{steps.next-version.outputs.version_tag}}
draft: false
prerelease: falses
- name: Update release asset
if: github.event_name == 'push'
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: ${{env.VSIX}}
asset_name: ${{env.VSIX_PROJECT}}.vsix
asset_content_type: application/zip
- name: add to marketplace
if: github.event_name == 'push'
uses: mrluje/vs-marketplace-publisher@v2
with:
pat: ${{ secrets.FCC_VS_MARKET_PLACE_PUBLISH_TOKEN }}
manifestPath: ${{env.VSIX_PROJECT}}\vs-market-place-manifest.json
vsixPath: ${{env.VSIX}}
- name: comment - released and added to marketplace
if: github.event_name == 'push'
uses: tonyhallett/addCommentToPullAndIssuesFromPushAction@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
comment: released ${{steps.next-version.outputs.version_tag}} and available on marketplace
addTo: pullandissues
3 changes: 2 additions & 1 deletion FineCodeCoverage.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{20
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
appveyor.yml = appveyor.yml
.github\workflows\addVsixLinkToIssues.yaml = .github\workflows\addVsixLinkToIssues.yaml
CHANGELOG.md = CHANGELOG.md
CONTRIBUTING.md = CONTRIBUTING.md
ISSUE_TEMPLATE.md = ISSUE_TEMPLATE.md
LICENSE = LICENSE
.github\workflows\push_pull.yaml = .github\workflows\push_pull.yaml
README.md = README.md
EndProjectSection
EndProject
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build status](https://ci.appveyor.com/api/projects/status/yq8s0ridnphpx4ig?svg=true)](https://ci.appveyor.com/project/FortuneN/finecodecoverage)

Download this extension from the [Visual Studio Market Place](https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage)
or get the [CI build](https://www.vsixgallery.com/extension/fcc-f339fe606-9d51-4fca-895c-d50375137b62). Previous versions can be obtained from [here](https://ci.appveyor.com/project/FortuneN/finecodecoverage/history).
or download from [releases](https://github.com/FortuneN/FineCodeCoverage/releases). Older versions can be obtained from [here](https://ci.appveyor.com/project/FortuneN/finecodecoverage/history).

---------------------------------------
Prerequisites
Expand Down Expand Up @@ -98,7 +98,7 @@ If you encounter **0% coverage or inconsistent coverage** it is now possible to
For now this is opt in. In the future Fine Code Coverage will determine the appropriate driver.
Please consult [coverlet docs](https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md) for version support.

**Note that it is unnecessary to add the nuget coverlet.collector package as FCC internally supplies coverlet.collector 3.0.3**
**Note that it is unnecessary to add the nuget coverlet.collector package as FCC internally supplies it.**

Fine Code Coverage will use the Data Collector driver under two circumstances :
1) You are testing with runsettings that contains the coverlet collector ( and not disabled)
Expand Down
20 changes: 6 additions & 14 deletions vs-market-place-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
"$schema": "http://json.schemastore.org/vsix-publish",
"categories": [ "coding", "reporting", "testing" ],
"identity": {
"description": "Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)", // The description of the extension. Required for non-vsix extensions.
"displayName": "Fine Code Coverage", // The display name of the extension. Required for non-vsix extensions.
"icon": "\\path\\to\\icon.ico", // The path to an icon file (can be relative to the json file location). Required for non-vsix extensions.
"installTargets": [ // The installation targets for the extension. Required for non-vsix extensions.
{
"sku": "Microsoft.VisualStudio.Community",
"version": "[16.0, 17.0)"
}
],
"description": "Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)",
"displayName": "Fine Code Coverage",
"internalName": "FineCodeCoverage",
"language": "en-US", // The default language id of the extension. Can be in the "1033" or "en-US" format. Required for non-vsix extensions.
"version": "1.1.0", // The version of the extension. Required for non-vsix extensions.
"vsixId": "fcc-f339fe606-9d51-4fca-895c-d50375137b62", // The vsix id of the extension. Not required but useful for showing updates to installed extensions.
"language": "en-US",
"vsixId": "fcc-f339fe606-9d51-4fca-895c-d50375137b62",
"tags": [
".net",
".net core",
Expand All @@ -38,8 +30,8 @@
"unit test",
"unit test coverage",
"vb",
"visual studio",
],
"visual studio"
]
},
"overview": "vs-market-place-overview.md",
"priceCategory": "free",
Expand Down

0 comments on commit 9f6730e

Please sign in to comment.