Sharing to ec2 #146
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake Build and Test | |
on: | |
push: | |
branches: [ ] | |
pull_request: | |
branches: [ ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Dependencies (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y openexr libopenexr-dev | |
sudo apt-get install -y \ | |
cmake pkg-config \ | |
libgl1-mesa-dev libwayland-dev wayland-protocols \ | |
libgtest-dev libxkbcommon-dev libxrandr-dev \ | |
libxinerama-dev libxcursor-dev libxi-dev \ | |
libbullet-dev libassimp-dev libimath-dev \ | |
- name: Install Dependencies (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
choco install mingw | |
choco install cmake | |
choco install git # Ensure git is available to clone repos | |
git clone https://github.com/google/googletest.git | |
cd googletest | |
mkdir build | |
cd build | |
cmake .. | |
cmake --build . --config Release | |
cmake --install . --prefix C:/googletest | |
- name: Initialize and Update Submodules | |
run: | | |
git submodule update --init --recursive | |
- name: Install GLFW (if necessary) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cd include/glfw | |
cmake -B build | |
cmake --build build | |
sudo cmake --install build | |
- name: Configure CMake & Build | |
run: | | |
mkdir -p build | |
cmake -B build | |
cmake --build ${{ github.workspace }}/build --config Debug --target all | |
- name: Test | |
working-directory: ${{ github.workspace }}/build/tests | |
run: ctest --rerun-failed --output-on-failure --verbose |