From b39b7e348b555e809c0aea34dfeb303512d2a8f6 Mon Sep 17 00:00:00 2001 From: Gunter Labes Date: Sun, 10 Jul 2022 23:18:22 +0200 Subject: [PATCH] Run test steps independently --- .github/workflows/ci-main.yml | 55 ++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 01ae799bd3a..2e45b0cf10b 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -28,6 +28,7 @@ jobs: image: wesnoth/wesnoth:2004-master options: --tty # docker create options env: + TOOL: ${{ matrix.tool }} CFG: ${{ matrix.cfg }} CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} @@ -45,42 +46,54 @@ jobs: with: submodules: "recursive" - - name: Start Xvfb - run: start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid - --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1024x768x24 - - name: Build wesnoth, wesnothd, campaignd and unit tests (scons) - if: matrix.tool == 'scons' - run: scons wesnoth wesnothd campaignd boost_unit_tests - build="$CFG" ctool="$CC" cxxtool="$CXX" cxx_std="$CXX_STD" - extra_flags_config="-pipe" strict=true forum_user_handler=true - nls="$NLS" enable_lto="$LTO" force_color=true jobs=2 --debug=time - - name: Build wesnoth, wesnothd, campaignd and unit tests (cmake) - if: matrix.tool == 'cmake' + - name: Build wesnoth, wesnothd, campaignd and unit tests + id: build # needed to check step outcome run: | - cmake -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true \ - -DENABLE_TESTS=true -DCMAKE_BUILD_TYPE="$CFG" -DCXX_STD="$CXX_STD" \ - -DEXTRA_FLAGS_CONFIG="-pipe" -DENABLE_STRICT_COMPILATION=true -DENABLE_MYSQL=true \ - -DENABLE_NLS="$NLS" -DFORCE_COLOR_OUTPUT=true -DENABLE_LTO="$LTO" -DLTO_JOBS=2 . - make conftests - make VERBOSE=1 -j2 + case $TOOL in + scons) + scons wesnoth wesnothd campaignd boost_unit_tests \ + build="$CFG" ctool="$CC" cxxtool="$CXX" cxx_std="$CXX_STD" \ + extra_flags_config="-pipe" strict=true forum_user_handler=true \ + nls="$NLS" enable_lto="$LTO" force_color=true jobs=2 --debug=time + ;; + cmake) + cmake -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true \ + -DENABLE_TESTS=true -DCMAKE_BUILD_TYPE="$CFG" -DCXX_STD="$CXX_STD" \ + -DEXTRA_FLAGS_CONFIG="-pipe" -DENABLE_STRICT_COMPILATION=true -DENABLE_MYSQL=true \ + -DENABLE_NLS="$NLS" -DFORCE_COLOR_OUTPUT=true -DENABLE_LTO="$LTO" -DLTO_JOBS=2 . + make conftests + make VERBOSE=1 -j2 + ;; + esac # - name: Rename debug binaries # if: matrix.cfg == 'debug' # run: mv wesnoth{-debug,}; mv wesnothd{-debug,}; mv campaignd{-debug,}; mv boost_unit_tests{-debug,} - - name: WML validation - run: ./utils/CI/schema_validation.sh - - name: Run luacheck - run: luacheck . + - name: Start Xvfb + if: success() || failure() + run: start-stop-daemon --start --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1024x768x24 - name: Whitespace and WML indentation check + if: success() || failure() run: ./utils/CI/fix_whitespace.sh; git status; (( $(git status --short | wc -l) == 0 )) + - name: Run luacheck + if: success() || failure() + run: luacheck . - name: Doxygen check + if: success() || failure() run: ./utils/CI/doxygen-check.sh + - name: WML validation + if: success() || steps.build.outcome == 'success' + run: ./utils/CI/schema_validation.sh - name: Run WML tests + if: success() || steps.build.outcome == 'success' run: ./run_wml_tests -g -c -t 20 - name: Run play tests + if: success() || steps.build.outcome == 'success' run: ./utils/CI/play_test_executor.sh - name: Run MP tests + if: success() || steps.build.outcome == 'success' run: ./utils/CI/mp_test_executor.sh - name: Run unit tests + if: success() || steps.build.outcome == 'success' run: ./utils/CI/test_executor.sh steam-runtime: