Skip to content

Commit

Permalink
add simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
drewcassidy committed Sep 4, 2024
1 parent 8761549 commit 4bfbc1c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/test-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@ name: test plugin mod build
on:
workflow_call:

defaults:
run:
working-directory: tests/plugin-mod
env:
TESTDIR: tests/plugin-mod

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: echo "Hello World"
- uses: ./.github/actions/setup-ckan

- uses: ./.github/actions/compile
with:
solution-file-path: ${ env.TESTDIR }/mymod.csproj
ksp-zip-url: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip

- uses: ./.github/actions/assemble-release
with:
artifacts: ${ env.TESTDIR }/GameData
Empty file removed tests/plugin-mod/foo
Empty file.
50 changes: 50 additions & 0 deletions tests/plugin-mod/mymod.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="MinVer" Version="5.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<!-- Static Properties -->
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<LangVersion>7.3</LangVersion>
<IsPackable>false</IsPackable>
<PlatformTarget>x64</PlatformTarget>
<NoWarn>1701;1702;CS0649;CS1591;</NoWarn>
<AssemblyCopyright>2024 KSPModdingLibs Contributors</AssemblyCopyright>
<AssemblyName>MyMod</AssemblyName>
<RepoRootPath>$(MSBuildThisFileDirectory)</RepoRootPath>
</PropertyGroup>

<!-- DLL Dependencies-->
<ItemGroup>
<Reference Include="0Harmony, Culture=neutral, PublicKeyToken=null">
<HintPath>$(KSPRoot)/GameData/000_Harmony/0Harmony.dll</HintPath>
<CKANIdentifier>Harmony2</CKANIdentifier>
<CKANVersion>2.2.1.0</CKANVersion>
<Private>False</Private>
</Reference>
</ItemGroup>

<!-- Version Files -->
<ItemGroup>
<KSPVersionFile Include=".">
<Destination>$(RepoRootPath)GameData/MyMod/mymod.version</Destination>
</KSPVersionFile>
</ItemGroup>

<PropertyGroup>
<GenerateKSPAssemblyAttribute>true</GenerateKSPAssemblyAttribute>
<GenerateKSPAssemblyDependencyAttributes>true</GenerateKSPAssemblyDependencyAttributes>
</PropertyGroup>

<Target Name="MakeModDir" BeforeTargets="BeforeBuild">
<MakeDir Directories="$(RepoRootPath)GameData/MyMod" />
</Target>

<Import Project="$(MSBuildThisFileDirectory)../../KSPCommon.targets" />
</Project>

0 comments on commit 4bfbc1c

Please sign in to comment.