From e11cf410e0edcab53f1bae9005ded5ad1721ae77 Mon Sep 17 00:00:00 2001 From: glx22 Date: Mon, 4 Dec 2023 22:45:45 +0100 Subject: [PATCH] Add: [CI] Test grf generation --- .github/workflows/ci-build.yml | 4 ++++ cmake/scripts/CreateGRF.cmake | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index dfdfbf0371be8..2da7d1870d36e 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -93,6 +93,7 @@ jobs: - name: GCC - Dedicated compiler: gcc cxxcompiler: g++ + libraries: grfcodec extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG" -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON # Compile without SDL / SDL2, as that should compile fine too. @@ -170,6 +171,9 @@ jobs: cd build ctest -j $(nproc) --timeout 120 + # Check no tracked files have been modified + git diff --exit-code + macos: strategy: fail-fast: false diff --git a/cmake/scripts/CreateGRF.cmake b/cmake/scripts/CreateGRF.cmake index 55e136ef4e714..eff9a7b959363 100644 --- a/cmake/scripts/CreateGRF.cmake +++ b/cmake/scripts/CreateGRF.cmake @@ -21,6 +21,9 @@ if(NOT GRF_BINARY_FILE) message(FATAL_ERROR "Script needs GRF_BINARY_FILE defined") endif() +# Remove the existing output so failures never go unnoticed +file(REMOVE ${GRF_BINARY_FILE} ${GRF_BINARY_FILE}.hash) + get_filename_component(GRF_SOURCE_FOLDER_NAME "${GRF_SOURCE_FOLDER}" NAME) file(WRITE sprites/${GRF_SOURCE_FOLDER_NAME}.nfo "")