Skip to content

Commit

Permalink
Merge pull request #6 from odalet/feature/modernize
Browse files Browse the repository at this point in the history
Feature/modernize closes issue #5
  • Loading branch information
odalet authored Oct 18, 2020
2 parents b710c1d + c46c930 commit 1529153
Show file tree
Hide file tree
Showing 77 changed files with 832 additions and 7,933 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Build

on:
push:
tags: ["v*"]
branches: ["**"]
pull_request:
branches: [ master ]

env:
SOLUTION: src/Delta.Units.sln
BUILD_CONFIGURATION: Release

jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Dump Environment
run: |
echo "Solution : ${{ env.SOLUTION }}"
echo "Configuration: ${{ env.BUILD_CONFIGURATION }}"
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # See https://github.com/GitTools/GitVersion/issues/2301
# Java 11 is needed by Sonar analyzer
- uses: actions/setup-java@v1
with:
java-version: 11
java-package: jdk
architecture: x64
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.3
with:
versionSpec: '5.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.3
- name: Install SonarScanner
run: dotnet tool install --global dotnet-sonarscanner
- name: Restore
run: dotnet restore "${{ env.SOLUTION }}" --configfile ./nuget.config
- name: Begin Sonar Analysis
run: dotnet sonarscanner begin /key:"odalet_Delta.Units" /name:"Delta.Units" /version:"${{ steps.gitversion.outputs.majorMinorPatch }}" /organization:"odalet" /d:sonar.cs.vstest.reportsPaths="**/TestResults/**/*.trx" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/*.opencover.xml" /d:sonar.coverage.exclusions="**Tests.cs" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.verbose=true /d:sonar.host.url=https://sonarcloud.io
- name: Build
run: dotnet build "${{ env.SOLUTION }}" --configuration "${{ env.BUILD_CONFIGURATION }}" --no-restore
- name: Test
run: dotnet test "${{ env.SOLUTION }}" --configuration "${{ env.BUILD_CONFIGURATION }}" --no-restore --no-build --logger trx --collect "Code Coverage" --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=./TestResults/
- name: End Sonar Analysis
run: dotnet sonarscanner end /d:sonar.login="${{secrets.SONAR_TOKEN}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Collect Nuget Packages (nupkg)
uses: actions/upload-artifact@v2
with:
name: nuget-packages
path: ./src/Delta.Units/bin/${{ env.BUILD_CONFIGURATION }}/*.nupkg
- name: Collect Nuget Packages (snupkg)
uses: actions/upload-artifact@v2
with:
name: nuget-packages
path: ./src/Delta.Units/bin/${{ env.BUILD_CONFIGURATION }}/*.snupkg
###########################################
# Release creation / publication
- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Nuget Package to Release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./src/Delta.Units/bin/${{ env.BUILD_CONFIGURATION }}/Delta.Units.${{ steps.gitversion.outputs.SemVer }}.nupkg
asset_name: Delta.Units.${{ steps.gitversion.outputs.SemVer }}.nupkg
asset_content_type: application/zip
- name: Upload Symbols Nuget Package to Release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./src/Delta.Units/bin/${{ env.BUILD_CONFIGURATION }}/Delta.Units.${{ steps.gitversion.outputs.SemVer }}.snupkg
asset_name: Delta.Units.${{ steps.gitversion.outputs.SemVer }}.snupkg
asset_content_type: application/zip

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,4 @@ __pycache__/
/doc/_site
/doc/api
/doc/obj
/.project
6 changes: 0 additions & 6 deletions CoverageShim/App.config

This file was deleted.

57 changes: 0 additions & 57 deletions CoverageShim/CoverageShim.csproj

This file was deleted.

16 changes: 0 additions & 16 deletions CoverageShim/Program.cs

This file was deleted.

36 changes: 0 additions & 36 deletions CoverageShim/Properties/AssemblyInfo.cs

This file was deleted.

6 changes: 0 additions & 6 deletions CoverageShim/packages.config

This file was deleted.

36 changes: 0 additions & 36 deletions Delta.Units.nuspec

This file was deleted.

43 changes: 0 additions & 43 deletions Delta.Units/Delta.Units.csproj

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2015 Parametric Portfolio Associates, 2019 AddUp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 0 additions & 37 deletions License.md

This file was deleted.

Loading

0 comments on commit 1529153

Please sign in to comment.