Skip to content

Commit

Permalink
Update cmake-multi-platform.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykorir authored Jan 6, 2025
1 parent b776efa commit c184644
Showing 1 changed file with 21 additions and 34 deletions.
55 changes: 21 additions & 34 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}

0 comments on commit c184644

Please sign in to comment.