Skip to content

Commit 25a5faa

Browse files
Merge branch 'master' into actions-test
2 parents 1b6f6d8 + 65af695 commit 25a5faa

File tree

191 files changed

+6487
-3117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+6487
-3117
lines changed

ImperatorToCK3/.editorconfig renamed to .editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Remove the line below if you want to inherit .editorconfig settings from higher directories
22
root = true
33

4+
### Editor guidelines
5+
# All files
6+
[*]
7+
guidelines = 80
8+
# C# or VB files
9+
[*.{cs,vb}]
10+
guidelines = 150
11+
412
# C# files
513
[*.cs]
614

.github/workflows/bump_version.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ jobs:
1111
with:
1212
fetch-depth: '0'
1313
- name: "Bump version and push tag"
14-
uses: anothrNick/github-tag-action@1.61.0
14+
uses: anothrNick/github-tag-action@1.62.0
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
1717
DEFAULT_BUMP: none
1818
WITH_V: false
19-
BRANCH_HISTORY: 'last'
2019
DEFAULT_BRANCH: 'master'
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Integration tests"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
concurrency:
8+
group: ci-integration-${{ github.ref }}-1
9+
cancel-in-progress: true
10+
11+
jobs:
12+
run_test_conversions:
13+
runs-on: [self-hosted, windows]
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
save_url:
18+
# 2.0 vanilla
19+
- https://mega.nz/file/TR13kB7D#QWT2yFzoS3rSIu9-EkUEdcc-X8jJnhZdXbJvw9jC-dg # Benchmark.rome
20+
# 2.0 with mods
21+
- https://mega.nz/file/id90lRYD#4OBL6N6_87-Nu28wNssm-O-3jmxli0iFzOtI7XVdN1E # Mega_Campaign.rome
22+
- https://mega.nz/file/zQ0wDKya#eiFQCiJ2sjTaolAJGnfQ0_0OS2Q1kf48dIGDlrEoJ9I # Erreinu Atlantikoa Debug Over NameFix.rome
23+
- https://mega.nz/file/yd1nAZpB#6pXqexexEAXgE04Kll1XYwz_IhRPr42juVIJQ4uKXM8 # The New Rome.rome
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
fetch-depth: 0
28+
submodules: recursive
29+
- name: "Check if docs folders exist"
30+
run: |
31+
ls "C:\Users\Administrator\Documents\Paradox Interactive\Imperator"
32+
ls "C:\Users\Administrator\Documents\Paradox Interactive\Imperator\mod"
33+
ls "C:\Users\Administrator\Documents\Paradox Interactive\Crusader Kings III\mod"
34+
- name: "Setup Dotnet for use with actions"
35+
uses: actions/setup-dotnet@v3
36+
with:
37+
global-json-file: global.json
38+
- name: "Build converter backend"
39+
working-directory: ImperatorToCK3
40+
run: |
41+
dotnet build -c:Debug
42+
- name: "Download I:R save from MEGA"
43+
run: |
44+
& "C:/Program Files/megatools/megatools.exe" dl --path "save.rome" ${{ matrix.save_url }}
45+
- name: "Create configuration.txt"
46+
working-directory: Debug/ImperatorToCK3
47+
run: |
48+
echo 'ImperatorDirectory = "C:\Program Files (x86)\Steam\steamapps\common\ImperatorRome"' > configuration.txt
49+
echo 'ImperatorDocDirectory = "C:\Users\Administrator\Documents\Paradox Interactive\Imperator"' >> configuration.txt
50+
echo 'CK3directory = "C:\Program Files (x86)\Steam\steamapps\common\Crusader Kings III"' >> configuration.txt
51+
echo 'targetGameModPath = "C:\Users\Administrator\Documents\Paradox Interactive\Crusader Kings III\mod"' >> configuration.txt
52+
echo 'SaveGame = "../../save.rome"' >> configuration.txt
53+
cat configuration.txt
54+
- name: "Run conversion"
55+
working-directory: Debug/ImperatorToCK3
56+
run: |
57+
dotnet ImperatorToCK3Converter.dll
58+
- name: "Cleanup"
59+
if: always()
60+
run: |
61+
Get-ChildItem -Path $Env:GITHUB_WORKSPACE -Recurse -Force | Remove-Item -force -recurse

.github/workflows/spelling.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Check spelling
1+
name: Check spelling
22
on: [pull_request]
33
jobs:
44
misspell:
55
name: Check spelling
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
8+
- uses: actions/checkout@v3
99
- name: Check spelling
1010
uses: reviewdog/action-misspell@v1
1111
with:

.github/workflows/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
jobs:
1313
test_and_check_coverage:
14-
runs-on: [self-hosted, linux]
14+
runs-on: [ubuntu-latest]
1515
steps:
1616
- uses: actions/checkout@v3
1717
with:
@@ -27,13 +27,14 @@ jobs:
2727
run: |
2828
$env:CoverletOutput='./TestResults/coverage.info'
2929
$env:CoverletOutputFormat='lcov'
30-
dotnet test /p:CollectCoverage=true /p:Exclude="[commonItems]*"
30+
dotnet test /p:CollectCoverage=true
3131
- name: "Publish coverage report to coveralls.io"
32-
uses: coverallsapp/github-action@master
32+
uses: coverallsapp/github-action@v2
3333
with:
3434
github-token: ${{ secrets.GITHUB_TOKEN }}
3535
path-to-lcov: ImperatorToCK3.UnitTests/TestResults/coverage.info
36-
36+
format: lcov
37+
debug: true
3738

3839
test:
3940
strategy:

Fronter.NET

Submodule Fronter.NET updated 56 files
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using commonItems;
2+
using ImperatorToCK3.CK3.Armies;
3+
using Xunit;
4+
5+
namespace ImperatorToCK3.UnitTests.CK3.Armies;
6+
7+
public class MenAtArmsTypeTests {
8+
[Fact]
9+
public void MenAtArmsTypeIsCorrectlySerialized() {
10+
var maaTypeReader = new BufferedReader("""
11+
{
12+
type = pikemen
13+
14+
damage = 30
15+
toughness = 24
16+
17+
terrain_bonus = {
18+
mountains = { damage = 5 toughness = 12 }
19+
desert_mountains = { damage = 5 toughness = 12 }
20+
hills = { damage = 3 toughness = 8 }
21+
}
22+
23+
counters = {
24+
pikemen = 0.5
25+
light_cavalry = 2
26+
heavy_cavalry = 2
27+
}
28+
29+
buy_cost = { gold = landsknecht_recruitment_cost }
30+
low_maintenance_cost = { gold = landsknecht_low_maint_cost }
31+
high_maintenance_cost = { gold = landsknecht_high_maint_cost }
32+
33+
stack = 100
34+
ai_quality = { value = @cultural_maa_extra_ai_score }
35+
icon = pikemen
36+
}
37+
""");
38+
39+
var menAtArmsType = new MenAtArmsType("landsknecht", maaTypeReader, new ScriptValueCollection());
40+
var serializedType = menAtArmsType.Serialize(indent: string.Empty, withBraces: true);
41+
42+
Assert.Contains("damage=30", serializedType);
43+
Assert.Contains("toughness=24", serializedType);
44+
Assert.Contains("terrain_bonus={", serializedType);
45+
Assert.Contains("buy_cost={", serializedType);
46+
Assert.Contains("stack=100", serializedType);
47+
Assert.Contains("icon=pikemen", serializedType);
48+
}
49+
}

0 commit comments

Comments
 (0)