Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
mkromis committed Jan 18, 2024
2 parents c1b1cb0 + 8ad01b5 commit e7aa964
Show file tree
Hide file tree
Showing 40 changed files with 753 additions and 623 deletions.
148 changes: 148 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: Verification Build

on:
push:
branches:
- develop
pull_request:
types: [opened, synchronize, reopened]

env:
solution: 'MinoriEditorShell.sln'
buildPlatform: Any CPU
buildConfiguration: Release

jobs:
build:
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

# if trying to build locally, make sure you have dotnet 3.1, 5.0 installed
# this container should have them pre-installed

# Needed for sonar analysis, even though java is installed
# sonar will not pick up version 11, so state specifically
# adopt is in tool cache so install should be quidker with it.
- name: Set up JDK 18
uses: actions/setup-java@v2
with:
distribution: 'adopt-hotspot' # Cached java
java-version: '18'

# Install GitVersion
# Requires .NET Core 3.1
# https://github.com/marketplace/actions/gittools
- name: 'Install GitVersion'
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true

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

- name: Use NuGet > 5.0.0
uses: nuget/setup-nuget@v1

- name: Restore dependencies
run: dotnet restore ${{env.solution}}

- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~\sonar\cache
key: ${{runner.os}}-sonar
restore-keys: ${{runner.os}}-sonar

- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v1
with:
path: .\.sonar\scanner
key: ${{runner.os}}-sonar-scanner
restore-keys: ${{runner.os}}-sonar-scanner

- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Prepare Scanner
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # Needed to get PR information, if any
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
shell: powershell
run: >
.\.sonar\scanner\dotnet-sonarscanner
begin /k:"mkromis_MinoriEditorShell" /o:"mkromis"
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
/d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml
/v:${{steps.gitversion.outputs.semVer}}
# projects uses GitVersion.MsBuild, so don't neeed to pass version
- name: Build
run: >
dotnet build ${{env.solution}}
--configuration ${{env.buildConfiguration}} --no-restore
-p:Version=${{steps.gitversion.outputs.FullSemVer}}
-p:FileVersion=${{steps.gitversion.outputs.AssemblySemFileVer}}
-p:InformationalVersion=${{steps.gitversion.outputs.InformationalVersion}}
- name: Create Artifacts
run: |
# Get list of all nupkgs
$nupkgs = Get-ChildItem -Path .\Modules -Filter *.nupkg -Recurse
$basedir = 'MinoriEditorSystem-' + $env:GitVersion_NuGetVersion
# Move each item into artifacts
# rm Artifacts -Recurse -Force
mkdir Artifacts\$basedir\Nugets
# Copy nugets to nuget folder
foreach ($nupkg in $nupkgs) {
$leaf = Split-Path $nupkg -Leaf
$outFile = "Artifacts\$basedir\Nugets\$leaf"
echo $nupkg.FullName ' -> ' $outFile
Copy-Item $nupkg.FullName $outFile
}
# Copy Demo Folder
#mkdir Artifacts\$basedir\Demos
cp Demos\SimpleDemo\SimpleDemo.WPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\SimpleDemo.WPF -Recurse
cp Demos\SimpleDemo\SimpleDemo.RibbonWPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\SimpleDemo.RibbonWPF -Recurse
cp Demos\MinoriDemo\MinoriDemo.WPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.WPF -Recurse
cp Demos\MinoriDemo\MinoriDemo.RibbonWPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.RibbonWPF -Recurse
# Compress folder into 7z file
cd Artifacts
7z a "$basedir.7z" $basedir
cd ..
- name: Test
run: dotnet test ${{env.solution}} --collect:"XPlat Code Coverage" --settings coverlet.runsettings

- name: Analyze build
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # Needed to get PR information, if any
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
shell: powershell
run: .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{secrets.SONAR_TOKEN}}"

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: MinoriEditorShell
path: Artifacts/*.7z
if-no-files-found: error
74 changes: 74 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#Note: This is a third party action and currently only supports Linux: https://github.com/marketplace/actions/create-zip-file

name: ${{ env.GitVersion.NuGetVersion }}

env:
solution: '**/MinoriEditorShell.sln'
buildPlatform: Any CPU
buildConfiguration: Release

on:
push:
branches:
- stable
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: microsoft/setup-msbuild@v1.0.2
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: 5.x
- name: Use NuGet > 5.0.0
uses: nuget/setup-nuget@v1
- name: GitVersion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
updateAssemblyInfo: true
- run: nuget restore ${{env.solution}}
- run: msbuild '${{ env.solution }}' /p:configuration='${{ env.buildConfiguration }}' /p:platform='${{ env.buildPlatform }}'
- name: Copy Nugets to demo folder
run: Copy '${{ env.agent.builddirectory }}/**/*.nupkg' '${{ env.Build.BinariesDirectory }}\Minori-${{ env.GitVersion.NuGetVersion }}\Nugets'
- name: Copy Nuget Files to artifacts
run: Copy '${{ env.agent.builddirectory }}/**/*.nupkg' '${{ github.workspace }}'

- name: Copy SimpleDemo.WPF Files
run: |
Copy 'Demos/SimpleDemo/SimpleDemo.Wpf/bin/Release/*.exe
*.dll
*\*.dll
' '${{ env.Build.BinariesDirectory }}/Minori-${{ env.GitVersion.NuGetVersion }}/Demos/SimpleDemo'
- name: Copy SimpleDemo.RibbonWPF Files
run: |
Copy 'Demos/SimpleDemo/SimpleDemo.RibbonWpf/bin/Release/*.exe
*.dll
*/*.dll
' '${{ env.Build.BinariesDirectory }}/Minori-${{ env.GitVersion.NuGetVersion }}/Demos/SimpleDemo'
- name: Copy MinoriDemo.WPF Files
run: |
Copy 'Demos/MinoriDemo/MinoriDemo.Wpf/bin/Release/*.exe
*.dll
*/*.dll
' '${{ env.Build.BinariesDirectory }}/Minori-${{ env.GitVersion.NuGetVersion }}/Demos/MinoriDemo'
- name: Copy MinoriEditorShell.RibbonWPF Files
run: |
Copy 'Demos/MinoriDemo/MinoriDemo.RibbonWpf/bin/Release/*.exe
*.dll
*/*.dll
' '${{ env.Build.BinariesDirectory }}/Minori-${{ env.GitVersion.NuGetVersion }}/Demos/MinoriDemo'
- # 'Note: This is a third party action and currently only supports Linux: https://github.com/marketplace/actions/create-zip-file'
uses: montudor/action-zip@v0.1.0
with:
args: zip -qq -r ${{ github.workspace }}/Minori-${{ env.GitVersion.NuGetVersion }}.7z ${{ env.Build.BinariesDirectory }}\Minori-${{ env.GitVersion.NuGetVersion }}

- uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}
name: drop

13 changes: 8 additions & 5 deletions .sonarlint/MinoriEditorShell.slconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"ServerUri": "http://localhost:9000",
"Organization": null,
"ProjectKey": "MinoriEditorShell",
"ServerUri": "https://sonarcloud.io/",
"Organization": {
"Key": "torisankitsune",
"Name": "Mark Kromis"
},
"ProjectKey": "TorisanKitsune_MinoriEditorShell",
"ProjectName": "MinoriEditorShell",
"Profiles": {
"CSharp": {
"ProfileKey": "AXJr3KqQtbcUywwuo8zS",
"ProfileTimestamp": "2020-05-31T17:52:03Z"
"ProfileKey": "AXHDDFLUVHc24qBALL5K",
"ProfileTimestamp": "2021-05-05T07:40:20Z"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="SonarQube - MinoriEditorShell Sonar way" Description="This rule set was automatically generated from SonarQube http://localhost:9000/profiles/show?key=AXJr3KqQtbcUywwuo8zS" ToolsVersion="14.0">
<RuleSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="SonarQube - MinoriEditorShell Sonar way" Description="This rule set was automatically generated from SonarQube https://sonarcloud.io/profiles/show?key=AXHDDFLUVHc24qBALL5K" ToolsVersion="14.0">
<Rules AnalyzerId="SonarAnalyzer.CSharp" RuleNamespace="SonarAnalyzer.CSharp">
<Rule Id="S100" Action="None" />
<Rule Id="S1006" Action="Warning" />
Expand All @@ -26,12 +26,11 @@
<Rule Id="S1121" Action="Warning" />
<Rule Id="S1123" Action="Warning" />
<Rule Id="S1125" Action="Info" />
<Rule Id="S1128" Action="Info" />
<Rule Id="S1128" Action="None" />
<Rule Id="S113" Action="None" />
<Rule Id="S1134" Action="Warning" />
<Rule Id="S1135" Action="Info" />
<Rule Id="S1144" Action="Warning" />
<Rule Id="S1145" Action="None" />
<Rule Id="S1147" Action="None" />
<Rule Id="S1151" Action="None" />
<Rule Id="S1155" Action="Info" />
Expand Down Expand Up @@ -72,7 +71,6 @@
<Rule Id="S1659" Action="None" />
<Rule Id="S1694" Action="None" />
<Rule Id="S1696" Action="None" />
<Rule Id="S1697" Action="None" />
<Rule Id="S1698" Action="None" />
<Rule Id="S1699" Action="Warning" />
<Rule Id="S1751" Action="Warning" />
Expand All @@ -88,8 +86,9 @@
<Rule Id="S1940" Action="Info" />
<Rule Id="S1944" Action="Warning" />
<Rule Id="S1994" Action="None" />
<Rule Id="S2070" Action="None" />
<Rule Id="S2053" Action="Warning" />
<Rule Id="S2114" Action="Warning" />
<Rule Id="S2115" Action="Warning" />
<Rule Id="S2123" Action="Warning" />
<Rule Id="S2148" Action="None" />
<Rule Id="S2156" Action="None" />
Expand All @@ -110,15 +109,14 @@
<Rule Id="S2252" Action="Warning" />
<Rule Id="S2259" Action="Warning" />
<Rule Id="S2275" Action="Warning" />
<Rule Id="S2278" Action="None" />
<Rule Id="S2290" Action="Warning" />
<Rule Id="S2291" Action="Warning" />
<Rule Id="S2292" Action="Info" />
<Rule Id="S2302" Action="None" />
<Rule Id="S2306" Action="Warning" />
<Rule Id="S2325" Action="None" />
<Rule Id="S2326" Action="Warning" />
<Rule Id="S2327" Action="Warning" />
<Rule Id="S2327" Action="None" />
<Rule Id="S2328" Action="Info" />
<Rule Id="S2330" Action="None" />
<Rule Id="S2333" Action="None" />
Expand Down Expand Up @@ -153,7 +151,6 @@
<Rule Id="S2743" Action="Warning" />
<Rule Id="S2755" Action="Warning" />
<Rule Id="S2757" Action="Warning" />
<Rule Id="S2758" Action="Warning" />
<Rule Id="S2760" Action="None" />
<Rule Id="S2761" Action="Warning" />
<Rule Id="S2857" Action="Warning" />
Expand All @@ -170,6 +167,7 @@
<Rule Id="S2997" Action="Warning" />
<Rule Id="S3005" Action="Warning" />
<Rule Id="S3010" Action="Warning" />
<Rule Id="S3011" Action="Warning" />
<Rule Id="S3052" Action="None" />
<Rule Id="S3060" Action="Warning" />
<Rule Id="S3168" Action="Warning" />
Expand Down Expand Up @@ -201,6 +199,7 @@
<Rule Id="S3263" Action="Warning" />
<Rule Id="S3264" Action="Warning" />
<Rule Id="S3265" Action="Warning" />
<Rule Id="S3329" Action="Warning" />
<Rule Id="S3343" Action="Warning" />
<Rule Id="S3346" Action="Warning" />
<Rule Id="S3353" Action="None" />
Expand Down Expand Up @@ -239,7 +238,6 @@
<Rule Id="S3610" Action="Warning" />
<Rule Id="S3626" Action="Info" />
<Rule Id="S3655" Action="Warning" />
<Rule Id="S3693" Action="None" />
<Rule Id="S3717" Action="None" />
<Rule Id="S3776" Action="Warning" />
<Rule Id="S3869" Action="Warning" />
Expand Down Expand Up @@ -270,7 +268,7 @@
<Rule Id="S3927" Action="Warning" />
<Rule Id="S3928" Action="Warning" />
<Rule Id="S3937" Action="None" />
<Rule Id="S3949" Action="Warning" />
<Rule Id="S3949" Action="None" />
<Rule Id="S3956" Action="None" />
<Rule Id="S3962" Action="None" />
<Rule Id="S3963" Action="Info" />
Expand All @@ -294,7 +292,7 @@
<Rule Id="S4004" Action="None" />
<Rule Id="S4005" Action="None" />
<Rule Id="S4015" Action="Warning" />
<Rule Id="S4016" Action="Warning" />
<Rule Id="S4016" Action="None" />
<Rule Id="S4017" Action="None" />
<Rule Id="S4018" Action="None" />
<Rule Id="S4019" Action="Warning" />
Expand All @@ -321,7 +319,6 @@
<Rule Id="S4069" Action="None" />
<Rule Id="S4070" Action="Warning" />
<Rule Id="S4136" Action="Info" />
<Rule Id="S4142" Action="None" />
<Rule Id="S4143" Action="Warning" />
<Rule Id="S4144" Action="Warning" />
<Rule Id="S4158" Action="Info" />
Expand All @@ -339,9 +336,9 @@
<Rule Id="S4261" Action="None" />
<Rule Id="S4275" Action="Warning" />
<Rule Id="S4277" Action="Warning" />
<Rule Id="S4423" Action="Warning" />
<Rule Id="S4426" Action="Warning" />
<Rule Id="S4428" Action="Warning" />
<Rule Id="S4432" Action="None" />
<Rule Id="S4433" Action="Warning" />
<Rule Id="S4456" Action="Warning" />
<Rule Id="S4457" Action="Warning" />
Expand All @@ -355,9 +352,11 @@
<Rule Id="S4635" Action="Warning" />
<Rule Id="S4830" Action="Warning" />
<Rule Id="S5034" Action="Warning" />
<Rule Id="S5445" Action="Warning" />
<Rule Id="S5542" Action="Warning" />
<Rule Id="S5547" Action="Warning" />
<Rule Id="S5659" Action="Warning" />
<Rule Id="S5773" Action="Warning" />
<Rule Id="S818" Action="Info" />
<Rule Id="S881" Action="None" />
<Rule Id="S907" Action="Warning" />
Expand Down
Loading

0 comments on commit e7aa964

Please sign in to comment.