Skip to content

Commit

Permalink
update workflow with template
Browse files Browse the repository at this point in the history
  • Loading branch information
olduh29 committed Jan 6, 2021
1 parent 5e2493a commit 002c3f2
Showing 1 changed file with 42 additions and 21 deletions.
63 changes: 42 additions & 21 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,67 @@ name: .NET Core

on:
push:
branches: [ master ]
branches:
- dev
- master
pull_request:
branches: [ master ]

jobs:
branches:
- dev
jobs:
build:
env:
TESTS_PROJECT: 'CoreLispTests/CoreLispTests.csproj'
PUBLISH_NUGET: true
RUN_TESTS: true
MAIN_CSPROJ: 'CoreLisp/CoreLisp.csproj'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
dotnet-version: 3.1.101
- name: Clean artifacts and nugets
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
- name: Build with dotnet
run: dotnet build --configuration Release
- name : test coverage with coverlet
id: coverlet
uses: b3b00/coverlet-action@1.0.997
run: dotnet build --configuration Release
- name: Test with dotnet
uses: b3b00/coverlet-action@1.1.0
id: 'coverlet'
if: env.RUN_TESTS
with:
testProject: 'CoreLispTests/CoreLispTests.csproj'
testProject: ${{env.TESTS_PROJECT}}
output: 'lcov.info'
outputFormat: 'lcov'
excludes: '[CoreLispTests]*,[corelisprepl]*,[program]*,[LispModel]*'
- name: push
excludes: '[program]*'
- name: coveralls
uses: coverallsapp/github-action@v1.1.1
if: matrix.os == 'windows-latest' && env.RUN_TESTS
with:
github-token: ${{secrets.GITHUB_TOKEN }}
path-to-lcov: ${{steps.coverlet.outputs.coverageFile}}
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@4.8.4
with:
reports: ${{steps.coverlet.outputs.coverageFile}}
targetdir: 'coveragereport'
reporttypes: 'HtmlInline;lcov'
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
tag: '${{ github.run_number }}_${{ github.run_id }}'
- name: publish nuget
if: matrix.os == 'windows-latest' && env.PUBLISH_NUGET
id: publish_nuget
uses: brandedoutcast/publish-nuget@v2.5.2
with:
VERSION_REGEX: <version>(.*)<\/version>
PROJECT_FILE_PATH: CoreLisp/CoreLisp.csproj
NUGET_KEY: ${{ secrets.NUGET_KEY }}
VERSION_FILE_PATH: CoreLisp/CoreLisp.csproj
PROJECT_FILE_PATH: ${{env.MAIN_CSPROJ}}
NUGET_KEY: ${{secrets.NUGET_KEY}}
VERSION_FILE_PATH: ${{env.MAIN_CSPROJ}}
- name: Create Release
if: ${{ success() && steps.publish_nuget.outputs.VERSION != '' && steps.publish_nuget.outputs.VERSION != null }}
if: ${{ success() && matrix.os == 'ubuntu-latest' && steps.publish_nuget.outputs.VERSION != '' && steps.publish_nuget.outputs.VERSION != null }}
id: create_release
uses: actions/create-release@latest
env:
Expand All @@ -51,7 +73,7 @@ jobs:
draft: false
prerelease: false
- name: Upload Release Asset
if: ${{ success() && steps.create_release.outputs.upload_url != '' && steps.create_release.outputs.upload_url != null }}
if: ${{ success() && matrix.os == 'ubuntu-latest' && steps.create_release.outputs.upload_url != '' && steps.create_release.outputs.upload_url != null }}
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
Expand All @@ -61,4 +83,3 @@ jobs:
asset_path: ${{ steps.publish_nuget.outputs.PACKAGE_PATH }}
asset_name: ${{ steps.publish_nuget.outputs.PACKAGE_NAME }}
asset_content_type: application/zip

0 comments on commit 002c3f2

Please sign in to comment.