Skip to content

Commit

Permalink
Merge branch 'master' into actions-test
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolai-laevskii authored May 9, 2023
2 parents 1b6f6d8 + 65af695 commit 25a5faa
Show file tree
Hide file tree
Showing 191 changed files with 6,487 additions and 3,117 deletions.
8 changes: 8 additions & 0 deletions ImperatorToCK3/.editorconfig → .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true

### Editor guidelines
# All files
[*]
guidelines = 80
# C# or VB files
[*.{cs,vb}]
guidelines = 150

# C# files
[*.cs]

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ jobs:
with:
fetch-depth: '0'
- name: "Bump version and push tag"
uses: anothrNick/github-tag-action@1.61.0
uses: anothrNick/github-tag-action@1.62.0
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
DEFAULT_BUMP: none
WITH_V: false
BRANCH_HISTORY: 'last'
DEFAULT_BRANCH: 'master'
61 changes: 61 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Integration tests"

on:
release:
types: [published]

concurrency:
group: ci-integration-${{ github.ref }}-1
cancel-in-progress: true

jobs:
run_test_conversions:
runs-on: [self-hosted, windows]
strategy:
fail-fast: false
matrix:
save_url:
# 2.0 vanilla
- https://mega.nz/file/TR13kB7D#QWT2yFzoS3rSIu9-EkUEdcc-X8jJnhZdXbJvw9jC-dg # Benchmark.rome
# 2.0 with mods
- https://mega.nz/file/id90lRYD#4OBL6N6_87-Nu28wNssm-O-3jmxli0iFzOtI7XVdN1E # Mega_Campaign.rome
- https://mega.nz/file/zQ0wDKya#eiFQCiJ2sjTaolAJGnfQ0_0OS2Q1kf48dIGDlrEoJ9I # Erreinu Atlantikoa Debug Over NameFix.rome
- https://mega.nz/file/yd1nAZpB#6pXqexexEAXgE04Kll1XYwz_IhRPr42juVIJQ4uKXM8 # The New Rome.rome
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: "Check if docs folders exist"
run: |
ls "C:\Users\Administrator\Documents\Paradox Interactive\Imperator"
ls "C:\Users\Administrator\Documents\Paradox Interactive\Imperator\mod"
ls "C:\Users\Administrator\Documents\Paradox Interactive\Crusader Kings III\mod"
- name: "Setup Dotnet for use with actions"
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: "Build converter backend"
working-directory: ImperatorToCK3
run: |
dotnet build -c:Debug
- name: "Download I:R save from MEGA"
run: |
& "C:/Program Files/megatools/megatools.exe" dl --path "save.rome" ${{ matrix.save_url }}
- name: "Create configuration.txt"
working-directory: Debug/ImperatorToCK3
run: |
echo 'ImperatorDirectory = "C:\Program Files (x86)\Steam\steamapps\common\ImperatorRome"' > configuration.txt
echo 'ImperatorDocDirectory = "C:\Users\Administrator\Documents\Paradox Interactive\Imperator"' >> configuration.txt
echo 'CK3directory = "C:\Program Files (x86)\Steam\steamapps\common\Crusader Kings III"' >> configuration.txt
echo 'targetGameModPath = "C:\Users\Administrator\Documents\Paradox Interactive\Crusader Kings III\mod"' >> configuration.txt
echo 'SaveGame = "../../save.rome"' >> configuration.txt
cat configuration.txt
- name: "Run conversion"
working-directory: Debug/ImperatorToCK3
run: |
dotnet ImperatorToCK3Converter.dll
- name: "Cleanup"
if: always()
run: |
Get-ChildItem -Path $Env:GITHUB_WORKSPACE -Recurse -Force | Remove-Item -force -recurse
4 changes: 2 additions & 2 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Check spelling
name: Check spelling
on: [pull_request]
jobs:
misspell:
name: Check spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check spelling
uses: reviewdog/action-misspell@v1
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:

jobs:
test_and_check_coverage:
runs-on: [self-hosted, linux]
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -27,13 +27,14 @@ jobs:
run: |
$env:CoverletOutput='./TestResults/coverage.info'
$env:CoverletOutputFormat='lcov'
dotnet test /p:CollectCoverage=true /p:Exclude="[commonItems]*"
dotnet test /p:CollectCoverage=true
- name: "Publish coverage report to coveralls.io"
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ImperatorToCK3.UnitTests/TestResults/coverage.info

format: lcov
debug: true

test:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion Fronter.NET
Submodule Fronter.NET updated 56 files
+1 −1 Fronter.NET.Tests/Fronter.Tests.csproj
+1 −1 Fronter.NET.Tests/Models/ConfigurationTests.cs
+2 −2 Fronter.NET.Tests/Services/MessageSlicerTests.cs
+6 −6 Fronter.NET.Tests/Services/UpdateCheckerTests.cs
+3 −3 Fronter.NET.Tests/ViewModels/MainWindowViewModelTests.cs
+3 −0 Fronter.NET.sln.DotSettings
+6 −1 Fronter.NET/App.axaml
+22 −33 Fronter.NET/App.axaml.cs
+1 −1 Fronter.NET/Extensions/DynamicLocExtension.cs
+1 −1 Fronter.NET/Extensions/LogExtensions.cs
+4 −4 Fronter.NET/Extensions/TranslationSource.cs
+15 −15 Fronter.NET/Fronter.csproj
+8 −8 Fronter.NET/LogAppenders/LogGridAppender.cs
+8 −8 Fronter.NET/Models/Configuration/Configuration.cs
+48 −0 Fronter.NET/Models/Configuration/Options/DateSelector.cs
+11 −10 Fronter.NET/Models/Configuration/Options/Option.cs
+4 −2 Fronter.NET/Models/Configuration/Options/RadioSelector.cs
+1 −1 Fronter.NET/Models/Configuration/Options/ToggleableOption.cs
+1 −1 Fronter.NET/Models/Configuration/RequiredFile.cs
+2 −2 Fronter.NET/Models/Configuration/RequiredFolder.cs
+1 −1 Fronter.NET/Models/Configuration/RequiredPath.cs
+1 −1 Fronter.NET/Models/ConverterReleaseAsset.cs
+1 −1 Fronter.NET/Models/ConverterReleaseInfo.cs
+8 −0 Fronter.NET/Models/FrontendTheme.cs
+1 −1 Fronter.NET/Models/UpdateInfoModel.cs
+1 −1 Fronter.NET/Program.cs
+1 −1 Fronter.NET/Resources/Configuration/converter_l_english.yml
+1 −1 Fronter.NET/Resources/Configuration/converter_l_french.yml
+1 −1 Fronter.NET/Resources/Configuration/converter_l_german.yml
+1 −1 Fronter.NET/Resources/Configuration/converter_l_italian.yml
+1 −1 Fronter.NET/Resources/Configuration/converter_l_latin.yml
+1 −1 Fronter.NET/Resources/Configuration/converter_l_russian.yml
+1 −1 Fronter.NET/Resources/Configuration/converter_l_simp_chinese.yml
+1 −1 Fronter.NET/Services/BrowserLauncher.cs
+8 −8 Fronter.NET/Services/ConverterLauncher.cs
+23 −24 Fronter.NET/Services/ModCopier.cs
+5 −5 Fronter.NET/Services/UpdateChecker.cs
+1 −1 Fronter.NET/ValueConverters/LocKeyToValueConverter.cs
+5 −2 Fronter.NET/ViewLocator.cs
+45 −15 Fronter.NET/ViewModels/MainWindowViewModel.cs
+11 −0 Fronter.NET/ViewModels/MenuItemViewModel.cs
+1 −1 Fronter.NET/ViewModels/ModsPickerViewModel.cs
+1 −1 Fronter.NET/ViewModels/OptionsViewModel.cs
+51 −19 Fronter.NET/ViewModels/PathPickerViewModel.cs
+1 −1 Fronter.NET/ViewModels/ViewModelBase.cs
+39 −28 Fronter.NET/Views/MainWindow.axaml
+1 −4 Fronter.NET/Views/MainWindow.axaml.cs
+1 −1 Fronter.NET/Views/ModsPickerView.axaml
+1 −1 Fronter.NET/Views/ModsPickerView.axaml.cs
+20 −5 Fronter.NET/Views/OptionsView.axaml
+1 −1 Fronter.NET/Views/OptionsView.axaml.cs
+13 −4 Fronter.NET/Views/PathPickerView.axaml
+1 −1 Fronter.NET/Views/PathPickerView.axaml.cs
+13 −0 README.md
+1 −1 Updater
+1 −1 global.json
49 changes: 49 additions & 0 deletions ImperatorToCK3.UnitTests/CK3/Armies/MenAtArmsTypeTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using commonItems;
using ImperatorToCK3.CK3.Armies;
using Xunit;

namespace ImperatorToCK3.UnitTests.CK3.Armies;

public class MenAtArmsTypeTests {
[Fact]
public void MenAtArmsTypeIsCorrectlySerialized() {
var maaTypeReader = new BufferedReader("""
{
type = pikemen

damage = 30
toughness = 24

terrain_bonus = {
mountains = { damage = 5 toughness = 12 }
desert_mountains = { damage = 5 toughness = 12 }
hills = { damage = 3 toughness = 8 }
}

counters = {
pikemen = 0.5
light_cavalry = 2
heavy_cavalry = 2
}

buy_cost = { gold = landsknecht_recruitment_cost }
low_maintenance_cost = { gold = landsknecht_low_maint_cost }
high_maintenance_cost = { gold = landsknecht_high_maint_cost }

stack = 100
ai_quality = { value = @cultural_maa_extra_ai_score }
icon = pikemen
}
""");

var menAtArmsType = new MenAtArmsType("landsknecht", maaTypeReader, new ScriptValueCollection());
var serializedType = menAtArmsType.Serialize(indent: string.Empty, withBraces: true);

Assert.Contains("damage=30", serializedType);
Assert.Contains("toughness=24", serializedType);
Assert.Contains("terrain_bonus={", serializedType);
Assert.Contains("buy_cost={", serializedType);
Assert.Contains("stack=100", serializedType);
Assert.Contains("icon=pikemen", serializedType);
}
}
Loading

0 comments on commit 25a5faa

Please sign in to comment.