Only run WML tests once and upload WML test data

This commit is contained in:
Gunter Labes 2024-09-08 22:50:35 +02:00
parent dfd9429e0d
commit 7c0e406d48
No known key found for this signature in database
GPG key ID: C0C7B971CC910216

View file

@ -54,9 +54,10 @@ jobs:
fail-fast: false
matrix:
include:
- { tool: scons, cc: gcc, cxx: g++, std: 17, cfg: debug, lto: false, sys_lua: false }
- { tool: cmake, cc: gcc, cxx: g++, std: 20, cfg: release, lto: true, sys_lua: false }
- { tool: cmake, cc: clang, cxx: clang++, std: 17, cfg: release, lto: true, sys_lua: true }
# the check for WML tests below may need to be adjusted if configurations are changed
- { cfg: debug, tool: scons, cc: gcc, cxx: g++, std: 17, lto: false, sys_lua: false }
- { cfg: release, tool: cmake, cc: gcc, cxx: g++, std: 20, lto: true, sys_lua: false }
- { cfg: release, tool: cmake, cc: clang, cxx: clang++, std: 17, lto: true, sys_lua: true }
runs-on: ubuntu-latest
container:
image: wesnoth/wesnoth:2404-master
@ -129,13 +130,20 @@ jobs:
printf '%s-path: %s\n' "$opt" "$output"
done
- name: WML validation
# only run on release builds (takes ~10 times as long on debug)
if: matrix.cfg == 'release' && (success() || steps.build.outcome == 'success')
# only run on release builds (takes ~10 times as long on debug); since there are multiple release builds
# but running the following tests multiple times doesn't make much sense use cc==clang as the check
if: matrix.cc == 'clang' && (success() || steps.build.outcome == 'success')
run: ./utils/CI/schema_validation.sh
- name: Run WML tests
# only run on release builds (takes ~6 times as long on debug)
if: matrix.cfg == 'release' && (success() || steps.build.outcome == 'success')
run: ./run_wml_tests -g -c -t 20 -bt 1000
if: matrix.cc == 'clang' && (success() || steps.build.outcome == 'success')
run: ./run_wml_tests -v -v -g -c -t 20 -bt 1000 -a=--userdata-dir=ud
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cc == 'clang' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: WMLTest-userdata-Linux
path: ud
- name: Run play tests
if: success() || steps.build.outcome == 'success'
run: ./utils/CI/play_test_executor.sh
@ -284,7 +292,13 @@ jobs:
path: projectfiles/Xcode/Wesnoth_${{ matrix.cfg }}.dmg
- name: Run WML tests
if: matrix.cfg == 'Release'
run: ./run_wml_tests -g -c -t 30 -p "projectfiles/Xcode/build/$CFG/The Battle for Wesnoth.app/Contents/MacOS/The Battle for Wesnoth"
run: ./run_wml_tests -g -c -t 30 -p "projectfiles/Xcode/build/$CFG/The Battle for Wesnoth.app/Contents/MacOS/The Battle for Wesnoth" -a=--userdata-dir="$PWD/ud"
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cfg == 'Release' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: WMLTest-userdata-MacOS
path: ud
- name: Run unit tests
run: ./run_boost_tests --path=projectfiles/Xcode/build/"$CFG" --executable=unit_tests
@ -331,7 +345,14 @@ jobs:
- name: Run WML unit tests
if: matrix.cfg == 'Release'
run: python run_wml_tests -v -g -c -t 20 -p %CFG%/wesnoth.exe
run: python run_wml_tests -v -g -c -t 20 -p %CFG%/wesnoth.exe -a=--userdata-dir=ud
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cfg == 'Release' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: WMLTest-userdata-Windows
path: ud
# run after all other jobs have completed to check overall build status
notification: