Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate generated mod with CWTools in integration tests #1282

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 76 additions & 41 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "Integration tests"

on:
pull_request: # TODO: remove it after getting CWTools step to work
release:
types: [published]

Expand All @@ -16,46 +17,80 @@ jobs:
matrix:
save_url:
# 2.0 vanilla
- https://mega.nz/file/TR13kB7D#QWT2yFzoS3rSIu9-EkUEdcc-X8jJnhZdXbJvw9jC-dg # Benchmark.rome
# - 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
# - 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
- 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: "Upload artifact with generated mod"
if: ${{ matrix.save_url }} == "https://mega.nz/file/yd1nAZpB#6pXqexexEAXgE04Kll1XYwz_IhRPr42juVIJQ4uKXM8"
uses: actions/upload-artifact@v3
with:
name: generated-mod-artifact
path: Debug/ImperatorToCK3/output/
- name: "Cleanup"
if: always()
run: |
Get-ChildItem -Path $Env:GITHUB_WORKSPACE -Recurse -Force | Remove-Item -force -recurse

validate_generated_mod:
needs: run_test_conversions
runs-on: ubuntu-latest
steps:
- name: "Download generated mod"
uses: actions/download-artifact@v3
with:
name: generated-mod-artifact
- name: "Display structure of downloaded files"
run: ls -R
- name: "Validate generated mod with ck3-tiger"
run: |
sudo wget -c https://github.com/amtep/ck3-tiger/releases/download/v0.6.1/ck3-tiger-linux-v0.6.1.tar.gz && tar -xzf ck3-tiger-linux-v0.6.1.tar.gz
./ck3-tiger-linux-v0.6.1/ck3-tiger --ck3 "C:/Program Files (x86)/Steam/steamapps/common/Crusader Kings III" generated-mod-artifact/test.mod
- name: "Validate generated mod with CWTools"
uses: cwtools/[email protected]
with:
game: ck3
changedFilesOnly: "0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required, secret is automatically set by github
- name: "Upload artifact"
if: always() # so even if the check fails, the log is uploaded
uses: actions/upload-artifact@v3
with:
name: cwtools_output
path: output.json