diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 64a230db4..a25d92534 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -1,6 +1,7 @@ name: "Integration tests" on: + pull_request: # TODO: remove it after getting CWTools step to work release: types: [published] @@ -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/cwtools-action@v1.1.0 + 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