diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3d69dbe..a9d0878 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "gitversion.tool": { - "version": "5.3.5", + "version": "5.6.10", "commands": [ "dotnet-gitversion" ] diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..4d3bec2 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,34 @@ +name: CI + +env: + CONFIGURATION: Release + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + include-prerelease: true + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore --configuration $Env:CONFIGURATION + + - name: Test + run: dotnet test --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.5.2 diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 0000000..a686f82 --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,49 @@ +name: Release + +env: + CONFIGURATION: Release + +on: + release: + types: [created] + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install tools + run: dotnet tool restore + +# gitversion calculates assembly version based on tag (etc) +# adds properties to project file +# also adds environment variables + - name: GitVersion + run: dotnet dotnet-gitversion /output buildserver /updateprojectfiles + + - name: Setup .NET 6 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + include-prerelease: true + + - name: Install dependencies + run: dotnet restore + +# ContinuousIntegrationBuild obfuscates source file paths + - name: Build + run: dotnet build --no-restore --configuration $Env:CONFIGURATION /p:ContinuousIntegrationBuild=true + + - name: Test + run: dotnet test --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover + + - name: Pack + run: dotnet pack --no-build -p:PackageVersion=$Env:GitVersion_NuGetVersionV2 + + - name: Publish + env: + NugetKey: ${{ secrets.NuGetKey }} + run: dotnet nuget push (Get-ChildItem *.nupkg -Recurse) --api-key $Env:NuGetKey --source https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml deleted file mode 100644 index 2f1532f..0000000 --- a/.github/workflows/dotnet-core.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Test - -env: - PROJECT: .\GraphEngine\GraphEngine.csproj - TEST_PROJECT: .\GraphEngine.Tests\GraphEngine.Tests.csproj - CONFIGURATION: Release - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - - name: Install tools - run: dotnet tool restore - - - name: Install dependencies - run: dotnet restore - -# gitversion calculates assembly version based on tag (etc) -# adds properties to project file -# also adds environment variables - - name: GitVersion - run: dotnet dotnet-gitversion /output buildserver /updateprojectfiles - -# ContinuousIntegrationBuild obfuscates source file paths - - name: Build - run: dotnet build $Env:PROJECT --configuration $Env:CONFIGURATION --no-restore /p:ContinuousIntegrationBuild=true - -# Use coverlet instead of vstest code coverage - - name: Install coverlet - run: dotnet add $Env:TEST_PROJECT package coverlet.msbuild - - - name: Test - run: dotnet test $Env:TEST_PROJECT --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - - - name: Pack - run: dotnet pack $Env:PROJECT --configuration $Env:CONFIGURATION --no-build -p:PackageVersion=$Env:GitVersion_NuGetVersionV2 - - - name: Publish NuGet - env: - NugetKey: ${{ secrets.NuGetKey }} - run: dotnet nuget push (Get-ChildItem *.nupkg -Recurse) --api-key $Env:NuGetKey --source https://api.nuget.org/v3/index.json diff --git a/GraphEngine.Tests/GraphEngine.Tests.csproj b/GraphEngine.Tests/GraphEngine.Tests.csproj index 1a2992f..49737ae 100644 --- a/GraphEngine.Tests/GraphEngine.Tests.csproj +++ b/GraphEngine.Tests/GraphEngine.Tests.csproj @@ -1,22 +1,22 @@  - netcoreapp3.1 + net6.0 false - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/GraphEngine.sln b/GraphEngine.sln index 494fb5a..617902b 100644 --- a/GraphEngine.sln +++ b/GraphEngine.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29509.3 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31423.177 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphEngine.Tests", "GraphEngine.Tests\GraphEngine.Tests.csproj", "{5CF037D7-1711-4E3F-8213-73FCE6CE0F8C}" EndProject @@ -9,10 +9,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphEngine", "GraphEngine\ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{95B632D7-6E0F-4F80-8F59-8443861DC3EA}" ProjectSection(SolutionItems) = preProject - .github\workflows\dotnet-core.yml = .github\workflows\dotnet-core.yml - .config\dotnet-tools.json = .config\dotnet-tools.json + .github\workflows\CI.yml = .github\workflows\CI.yml IDEAS = IDEAS README.md = README.md + .github\workflows\Release.yml = .github\workflows\Release.yml EndProjectSection EndProject Global diff --git a/GraphEngine/GraphEngine.csproj b/GraphEngine/GraphEngine.csproj index 127b94d..a19dd34 100644 --- a/GraphEngine/GraphEngine.csproj +++ b/GraphEngine/GraphEngine.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - 8.0 + net6.0 enable ExpressionRDF Samu Lang @@ -15,6 +14,7 @@ true snupkg true + AllEnabledByDefault @@ -30,11 +30,7 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/README.md b/README.md index 591304d..c12e10e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -[![Build](https://github.com/langsamu/GraphEngine/workflows/Test/badge.svg)](https://github.com/langsamu/GraphEngine/actions?query=workflow%3ATest) -[![Codecov](https://codecov.io/gh/langsamu/GraphEngine/branch/master/graph/badge.svg)](https://codecov.io/gh/langsamu/GraphEngine) +[![Build](https://github.com/langsamu/GraphEngine/workflows/CI/badge.svg)](https://github.com/langsamu/GraphEngine/actions?query=workflow%3ACI) +[![Codecov](https://codecov.io/gh/langsamu/GraphEngine/branch/main/graph/badge.svg)](https://codecov.io/gh/langsamu/GraphEngine)