Skip to content

Commit

Permalink
Merge pull request #12 from chickensoft-games/refactor/updates
Browse files Browse the repository at this point in the history
refactor: rename project, add types
  • Loading branch information
jolexxa committed Apr 27, 2024
2 parents bc6a35a + 03a5d80 commit ebc3d58
Show file tree
Hide file tree
Showing 40 changed files with 603 additions and 452 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: '📦 Release'
on:
# Make a release whenever we push a version tag.
push:
tags:
- 'v*'
# Make a release whenever the developer wants.
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -72,15 +68,15 @@ jobs:
find: "0.0.0-devbuild"
replace: ${{ steps.next-version.outputs.version }}
regex: false
include: Chickensoft.GoDotCollections/Chickensoft.GoDotCollections.csproj
include: Chickensoft.Collections/Chickensoft.Collections.csproj

- name: 📦 Build
run: dotnet build Chickensoft.GoDotCollections/Chickensoft.GoDotCollections.csproj -c Release
run: dotnet build Chickensoft.Collections/Chickensoft.Collections.csproj -c Release

- name: 🔎 Get Package Path
id: package-path
run: |
package=$(find ./Chickensoft.GoDotCollections/nupkg -name "*.nupkg")
package=$(find ./Chickensoft.Collections/nupkg -name "*.nupkg")
echo "package=$package" >> "$GITHUB_OUTPUT"
echo "📦 Found package: $package"
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,8 @@ jobs:
- name: 📦 Restore Dependencies
run: dotnet restore

- name: 🤖 Setup Godot
uses: chickensoft-games/setup-godot@v2
with:
version: global.json

- name: 🔬 Verify Setup
run: |
dotnet --version
godot --version
- name: 🧑‍🔬 Generate .NET Bindings
working-directory: Chickensoft.GoDotCollections.Tests
run: godot --headless --build-solutions --quit || exit 0

- name: 🦺 Build Projects
run: dotnet build # --configuration Release

- name: 🧪 Run Tests
working-directory: Chickensoft.GoDotCollections.Tests
run: godot --headless --run-tests --quit-on-finish
run: dotnet test
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Chickensoft.GoDotCollections/nupkg/
Chickensoft.Collections/nupkg/

Chickensoft.GoDotCollections.Tests/coverage/*
!Chickensoft.GoDotCollections.Tests/coverage/.gdignore
Chickensoft.Collections.Tests/coverage/*

.godot/
bin/
obj/
.generated/
Expand Down
39 changes: 0 additions & 39 deletions .vscode/launch.json

This file was deleted.

9 changes: 4 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,13 @@
// Allow html in markdown.
"MD033": false,
// Allow non-unique heading names so we don't break the changelog.
"MD024": false
"MD024": false,
},
"markdownlint.ignore": [
"**/LICENSE"
"markdownlint.lintWorkspaceGlobs": [
"!**/LICENSE"
],
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableMsBuildLoadProjectsOnDemand": false,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.maxFindSymbolsItems": 3000,
"omnisharp.organizeImportsOnFormat": true,
"omnisharp.useModernNet": true,
Expand All @@ -163,4 +162,4 @@
}
},
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true
}
}
25 changes: 4 additions & 21 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
{
"label": "coverage",
"group": "test",
"command": "${workspaceFolder}/Chickensoft.GoDotCollections.Tests/coverage.sh",
"command": "${workspaceFolder}/Chickensoft.Collections.Tests/coverage.sh",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/Chickensoft.GoDotCollections.Tests"
"cwd": "${workspaceFolder}/Chickensoft.Collections.Tests"
},
"presentation": {
"echo": true,
Expand All @@ -35,23 +35,6 @@
"showReuseMessage": false,
"clear": true
},
},
{
"label": "build-solutions",
"group": "test",
"command": "dotnet restore; ${env:GODOT} --headless --build-solutions --quit || exit 0",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/Chickensoft.GoDotCollections.Tests"
},
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false
}
},
}
]
}
}
28 changes: 28 additions & 0 deletions Chickensoft.Collections.Tests.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chickensoft.Collections", "Chickensoft.Collections\Chickensoft.Collections.csproj", "{4789AFE1-321A-4D01-877D-59FAE5C8E666}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chickensoft.Collections.Tests", "Chickensoft.Collections.Tests\Chickensoft.Collections.Tests.csproj", "{C6729B76-21EB-4C52-87EF-B1F8DA06673D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4789AFE1-321A-4D01-877D-59FAE5C8E666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4789AFE1-321A-4D01-877D-59FAE5C8E666}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4789AFE1-321A-4D01-877D-59FAE5C8E666}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4789AFE1-321A-4D01-877D-59FAE5C8E666}.Release|Any CPU.Build.0 = Release|Any CPU
{C6729B76-21EB-4C52-87EF-B1F8DA06673D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6729B76-21EB-4C52-87EF-B1F8DA06673D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6729B76-21EB-4C52-87EF-B1F8DA06673D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6729B76-21EB-4C52-87EF-B1F8DA06673D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
39 changes: 39 additions & 0 deletions Chickensoft.Collections.Tests/Chickensoft.Collections.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LangVersion>preview</LangVersion>
<DebugType>portable</DebugType>

<!-- To show generated files -->
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>.generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Shouldly" Version="4.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../Chickensoft.Collections/Chickensoft.Collections.csproj" />
</ItemGroup>
</Project>
45 changes: 45 additions & 0 deletions Chickensoft.Collections.Tests/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

dotnet build

dotnet test \
-p:CollectCoverage=true \
-p:CoverletOutputFormat="opencover" \
-p:CoverletOutput=./coverage/

reportgenerator \
-reports:"./coverage/coverage.opencover.xml" \
-targetdir:"./coverage/report" \
"-assemblyfilters:-*Chickensoft.LogicBlocks.Generator*" \
-reporttypes:"Html;Badges"

# Copy badges into their own folder. The badges folder should be included in
# source control so that the README.md in the root can reference the badges.

mkdir -p ./badges
mv ./coverage/report/badge_branchcoverage.svg ./badges/branch_coverage.svg
mv ./coverage/report/badge_linecoverage.svg ./badges/line_coverage.svg

# Determine OS, open coverage accordingly.

case "$(uname -s)" in

Darwin)
echo 'Mac OS X'
open coverage/report/index.htm
;;

Linux)
echo 'Linux'
xdg-open coverage/report/index.htm
;;

CYGWIN*|MINGW32*|MSYS*|MINGW*)
echo 'MS Windows'
start coverage/report/index.htm
;;

*)
echo 'Other OS'
;;
esac
Loading

0 comments on commit ebc3d58

Please sign in to comment.