-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
753 additions
and
623 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: 5.x | ||
- name: Use NuGet > 5.0.0 | ||
uses: nuget/setup-nuget@v1 | ||
- name: GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
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/[email protected] | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.