Skip to content

Commit

Permalink
modified the yml github actions fiile to be windows pswh friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykorir committed Jan 5, 2025
1 parent 7bf1642 commit 9547fac
Showing 1 changed file with 16 additions and 53 deletions.
69 changes: 16 additions & 53 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,34 @@ jobs:
build:
runs-on: ${{ matrix.os }}

permissions: write-all

strategy:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Release]
c_compiler: [gcc, clang, cl]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl

steps:
- uses: actions/checkout@v4
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive' # Ensure submodules are updated
submodules: 'recursive'

- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Install dependencies for Ubuntu
# Step 2: 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
- name: Create build directory
run: |
mkdir -p ${{ github.workspace }}/build
- name: Configure CMake
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DwxBUILD_SHARED=OFF \
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-B ${{ github.workspace }}/build -S ${{ github.workspace }}
- name: Build the project
- name: Install dependencies on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} --clean-first
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
choco install visualstudio2019buildtools -y --ignore-checksums
choco install git -y
- name: Test
working-directory: ${{ github.workspace }}/build
# Step 3: Call cmake for build and testing
- name: Build and test using CMake
run: |
ctest --build-config ${{ matrix.build_type }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: minesweeper
path: ${{ github.workspace }}/build
overwrite: true
mkdir build && cd build
cmake .. && cmake --build . --config Release
ctest --output-on-failure

0 comments on commit 9547fac

Please sign in to comment.