diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 4e98f5f..583187f 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -20,62 +20,49 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - submodules: recursive + submodules: false # Disable automatic submodule initialization - # Step 2: Install dependencies + # Step 2: Initialize and update submodules + - name: Initialize and update submodules + run: | + git submodule sync + git submodule update --init --recursive + if [ ! -d "external/wxWidgets" ]; then + echo "wxWidgets submodule is not initialized properly!" + exit 1 + fi + shell: bash + + # Step 3: Install dependencies - name: Install dependencies on Ubuntu if: ${{ matrix.os == 'ubuntu-latest' }} run: | sudo apt-get update - sudo apt-get install -y build-essential libgtk-3-dev cmake apt-utils git wget + sudo apt-get install -y build-essential libgtk-3-dev cmake git wget libjpeg-dev libpng-dev libtiff-dev libglib2.0-dev zlib1g-dev libexpat1-dev - name: Install dependencies on Windows if: ${{ matrix.os == 'windows-latest' }} + shell: pwsh run: | choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y choco install visualstudio2019buildtools -y --ignore-checksums choco install git -y - # Step 3: Create build directory for wxWidgets on Ubuntu - - name: Create build directory for wxWidgets on Ubuntu - if: ${{ matrix.os == 'ubuntu-latest' }} + # Step 4: Build wxWidgets + - name: Build wxWidgets run: | mkdir -p external/wxWidgets/build cd external/wxWidgets/build cmake .. -DCMAKE_BUILD_TYPE=Release -DwxBUILD_SHARED=OFF cmake --build . --config Release + shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }} - # Step 3: Create build directory for wxWidgets on Windows - - name: Create build directory for wxWidgets on Windows - if: ${{ matrix.os == 'windows-latest' }} - shell: pwsh - run: | - if (-Not (Test-Path "external/wxWidgets/build")) { - New-Item -ItemType Directory -Path external/wxWidgets/build - } - cd external/wxWidgets/build - cmake .. -DCMAKE_BUILD_TYPE=Release -DwxBUILD_SHARED=OFF - cmake --build . --config Release - - # Step 4: Build and test the project on Ubuntu - - name: Build and test the project on Ubuntu - if: ${{ matrix.os == 'ubuntu-latest' }} + # Step 5: Build and test the Minesweeper project + - name: Build and test the Minesweeper project run: | mkdir -p build cd build cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release ctest --output-on-failure - - # Step 4: Build and test the project on Windows - - name: Build and test the project on Windows - if: ${{ matrix.os == 'windows-latest' }} - shell: pwsh - run: | - if (-Not (Test-Path "build")) { - New-Item -ItemType Directory -Path build - } - cd build - cmake .. -DCMAKE_BUILD_TYPE=Release - cmake --build . --config Release - ctest --output-on-failure + shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}