Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/decouple xaml code add net6 0 #358

Merged
merged 19 commits into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ Thanks for submitting a pull request! Please provide enough information so that
A similar PR may already be submitted!
Please search among the Pull request before creating one: https://github.com/codebude/QRCoder/pulls?utf8=%E2%9C%93&q=

For more information, see the `CONTRIBUTING` guide.
For more information, see the `CONTRIBUTING` guide.-->


**Summary**

## Summary
<!-- Summarize your pull request in a couple of words -->

This PR fixes/implements the following **bugs/features**:
Expand All @@ -20,16 +19,12 @@ This PR fixes/implements the following **bugs/features**:
* [ ] Breaking changes

<!-- You can skip this if you're fixing a typo or other minor things -->

What existing problem does the pull request solve?

### What existing problem does the pull request solve?**
<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->

**Test plan**

Demonstrate that your code is solid. If possible add a short test case/test steps.

**Closing issues**
## Test plan
<!-- Demonstrate that your code is solid. If possible add a short test case/test steps. -->

## Closing issues
<!-- Put `closes #XXXX` (XXXX=issue number) in your comment to auto-close the issue that your PR fixes (if such). -->
Fixes #
76 changes: 63 additions & 13 deletions .github/workflows/wf-build-release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ on:
workflow_dispatch:
jobs:
build:
runs-on: windows-2022
runs-on: windows-2019
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v1
name: Checkout Code

- name: Setup MSBuild Ppth

- name: Install additional .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
1.0.x
2.0.x
5.0.x
6.0.x

- name: Setup MSBuild Path
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet
Expand All @@ -23,7 +32,7 @@ jobs:
run: nuget restore QRCoder.sln

- name: Build library
run: msbuild QRCoder.sln /p:Configuration=Release /nr:false /t:Rebuild
run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild

- name: Upload artifacts
uses: actions/upload-artifact@v1.0.0
Expand All @@ -33,64 +42,86 @@ jobs:

test:
needs: build
runs-on: windows-2022
runs-on: windows-2019
steps:
- name: Download artifacts
uses: actions/download-artifact@v1.0.0
with:
name: Compiled project
path: D:\a\qrcoder\qrcoder

- name: Install additional .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
1.0.x
2.0.x
5.0.x
6.0.x

- name: Run test .NET 3.5
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stron naming
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stronh naming

- name: Run test .NET 4.52
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Stron naming
- name: Run test .NET Core 1.3
run: dotnet test -c Release -f netcoreapp1.3 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Strong naming

- name: Run test .NET Core 1.1
run: dotnet test -c Release -f netcoreapp1.1 --nologo # No coverage for .NETCORE 1.1 because Coverlet doesn't support it https://github.com/coverlet-coverage/coverlet/issues/466

- name: Run test .NET Core 2.0
run: dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Run test .NET 5.0
run: dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Run test .NET 5.0 Windows
run: dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Run test .NET 6.0
run: dotnet test -c Release -f net6.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Run test .NET 6.0 Windows
run: dotnet test -c Release -f net6.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Codecov update netcoreapp2.0
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.netcoreapp2.0.opencover.xml
flags: netcoreapp2.0

- name: Codecov update net5.0
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.net5.0.opencover.xml
flags: net5.0

- name: Codecov update net5.0-windows
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
flags: net5.0-windows

- name: Codecov update net6.0
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.net5.0.opencover.xml
flags: net5.0
flags: net6.0

- name: Codecov update net6.0-windows
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
flags: net5.0-windows
flags: net6.0-windows


pack-push-ci:
needs: test
runs-on: windows-2022
runs-on: windows-2019
env:
GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }}
steps:
Expand All @@ -99,32 +130,51 @@ jobs:
with:
name: Compiled project
path: D:\a\qrcoder\qrcoder

- name: Install additional .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
1.0.x
2.0.x
5.0.x
6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Get assembly version QRCoder
run: echo "ASSEM_VER=$([Reflection.Assembly]::Loadfile( $(-join($pwd,"\QRCoder\bin\Release\net40\QRCoder.dll"))).GetName().version.ToString())" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Clean assembly version QRCoder
run: echo "ASSEM_VER_SHT=$($env:ASSEM_VER.substring(0, $env:ASSEM_VER.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Calculate ci suffix QRCoder
run: echo "CI_TAG=-ci-$([datetime]::now.tostring("yyyyMMddHHmmss"))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Get assembly version QRCoder.Xaml
run: echo "ASSEM_VER_XAML=$([Reflection.Assembly]::Loadfile( $(-join($pwd,"\QRCoder.Xaml\bin\Release\net40\QRCoder.Xaml.dll"))).GetName().version.ToString())" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Clean assembly version QRCoder.Xaml
run: echo "ASSEM_VER_SHT_XAML=$($env:ASSEM_VER_XAML.substring(0, $env:ASSEM_VER_XAML.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Calculate ci suffix QRCoder.Xaml
run: echo "CI_TAG_XAML=-ci-$([datetime]::now.tostring("yyyyMMddHHmmss"))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Build QRCoder NuGet package
run: dotnet pack QRCoder\QRCoder.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT$env:CI_TAG" /p:PackageReleaseNotes="- This is an automatic CI build ($env:CI_TAG)`n- Please don't use it in productive environments!"

- name: Build QRCoder.Xaml NuGet package
run: dotnet pack QRCoder.Xaml\QRCoder.Xaml.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT_XAML$env:CI_TAG_XAML" /p:PackageReleaseNotes="- This is an automatic CI build ($env:CI_TAG_XAML)`n- Please don't use it in productive environments!"

- name: Publish QRCoder and QRCoder.Xaml to Github packages
run: dotnet nuget push "**/*.nupkg" --no-symbols --skip-duplicate --api-key $env:GH_PKG_SEC --source https://nuget.pkg.github.com/codebude/index.json


clean:
needs: [build, test, pack-push-ci]
if: always()
runs-on: windows-2022
runs-on: windows-2019
steps:
- name: Delete artifacts
uses: GeekyEggo/delete-artifact@v1.0.0
Expand Down
72 changes: 60 additions & 12 deletions .github/workflows/wf-build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,23 @@ on:
required: true
jobs:
build:
runs-on: windows-2022
runs-on: windows-2019
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v1
name: Checkout Code

- name: Install additional .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
1.0.x
2.0.x
5.0.x
6.0.x

- name: Setup MSBuild Ppth
- name: Setup MSBuild Path
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet
Expand All @@ -24,7 +33,7 @@ jobs:
run: nuget restore QRCoder.sln

- name: Build library
run: msbuild QRCoder.sln /p:Configuration=Release /nr:false /t:Rebuild
run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild

- name: Upload artifacts
uses: actions/upload-artifact@v1.0.0
Expand All @@ -34,63 +43,85 @@ jobs:

test:
needs: build
runs-on: windows-2022
runs-on: windows-2019
steps:
- name: Download artifacts
uses: actions/download-artifact@v1.0.0
with:
name: Compiled project
path: D:\a\qrcoder\qrcoder

- name: Install additional .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
1.0.x
2.0.x
5.0.x
6.0.x

- name: Run test .NET 3.5
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stron naming
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stronh naming

- name: Run test .NET 4.52
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Stron naming
- name: Run test .NET Core 1.3
run: dotnet test -c Release -f netcoreapp1.3 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Strong naming

- name: Run test .NET Core 1.1
run: dotnet test -c Release -f netcoreapp1.1 --nologo # No coverage for .NETCORE 1.1 because Coverlet doesn't support it https://github.com/coverlet-coverage/coverlet/issues/466

- name: Run test .NET Core 2.0
run: dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Run test .NET 5.0
run: dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Run test .NET 5.0 Windows
run: dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Run test .NET 6.0
run: dotnet test -c Release -f net6.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Run test .NET 6.0 Windows
run: dotnet test -c Release -f net6.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Codecov update netcoreapp2.0
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.netcoreapp2.0.opencover.xml
flags: netcoreapp2.0

- name: Codecov update net5.0
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.net5.0.opencover.xml
flags: net5.0

- name: Codecov update net5.0-windows
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
flags: net5.0-windows

- name: Codecov update net6.0
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.net5.0.opencover.xml
flags: net5.0
flags: net6.0

- name: Codecov update net6.0-windows
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
flags: net5.0-windows
flags: net6.0-windows

pack-push-release:
needs: test
runs-on: windows-2022
runs-on: windows-2019
env:
GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }}
steps:
Expand All @@ -99,28 +130,45 @@ jobs:
with:
name: Compiled project
path: D:\a\qrcoder\qrcoder

- name: Install additional .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
1.0.x
2.0.x
5.0.x
6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Get assembly version QRCoder
run: echo "ASSEM_VER=$([Reflection.Assembly]::Loadfile( $(-join($pwd,"\QRCoder\bin\Release\net40\QRCoder.dll"))).GetName().version.ToString())" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Clean assembly version QRCoder
run: echo "ASSEM_VER_SHT=$($env:ASSEM_VER.substring(0, $env:ASSEM_VER.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Get assembly version QRCoder.Xaml
run: echo "ASSEM_VER_XAML=$([Reflection.Assembly]::Loadfile( $(-join($pwd,"\QRCoder.Xaml\bin\Release\net40\QRCoder.Xaml.dll"))).GetName().version.ToString())" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Clean assembly version QRCoder.Xaml
run: echo "ASSEM_VER_SHT_XAML=$($env:ASSEM_VER_XAML.substring(0, $env:ASSEM_VER_XAML.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

- name: Build QRCoder NuGet package
run: dotnet pack QRCoder\QRCoder.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT" /p:PackageReleaseNotes="${{ github.event.inputs.releaseNotes }}"

- name: Build QRCoder.Xaml NuGet package
run: dotnet pack QRCoder.Xaml\QRCoder.Xaml.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT_XAML" /p:PackageReleaseNotes="${{ github.event.inputs.releaseNotes }}"

- name: Publish QRCoder and QRCoder.Xaml to Github packages
run: dotnet nuget push "**/*.nupkg" --no-symbols --skip-duplicate --api-key $env:GH_PKG_SEC --source https://nuget.pkg.github.com/codebude/index.json


clean:
needs: [build, test, pack-push-release]
if: always()
runs-on: windows-2022
runs-on: windows-2019
steps:
- name: Delete artifacts
uses: GeekyEggo/delete-artifact@v1.0.0
Expand Down
Loading