Merge pull request #54 from YGNI-RType/feat/connection-systems #200
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: Compilation | |
on: | |
push: | |
branches: ["dev", "feat/ci"] | |
pull_request: | |
branches: ["main", "dev"] | |
jobs: | |
build_gengine: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
#TODO Consider changing this to true when your workflow is stable. | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-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++ | |
- os: macos-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 | |
- os: macos-latest | |
c_compiler: gcc | |
- os: macos-latest | |
c_compiler: cl | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install ubuntu packages necessary for glfw3 | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config | |
- name: Install vcpkg and dependencies for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
git clone https://github.com/microsoft/vcpkg.git | |
.\vcpkg\bootstrap-vcpkg.bat | |
.\vcpkg\vcpkg install glfw3:x64-windows | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
- name: Configure CMake | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-DCMAKE_TOOLCHAIN_FILE=../cmake/define-compilers.cmake | |
-S ${{ github.workspace }} | |
- name: Build | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
- name: Test | |
working-directory: ${{ steps.strings.outputs.build-output-dir }} | |
run: ctest --build-config ${{ matrix.build_type }} | |
cleanup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check for build artifacts | |
run: | | |
artifacts=$(find ${{ github.workspace }} -type f -name "*.so" -o -name "*.o" -o -name "*.d" -o -name "*.a") | |
if [ -n "$artifacts" ]; then | |
echo "Found unwanted artifacts:" | |
echo "$artifacts" | |
exit 1 | |
else | |
echo "No unwanted artifacts found." | |
fi | |
beautify: | |
runs-on: ubuntu-latest | |
container: | |
image: fedora:40 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install clang-format | |
run: sudo dnf install clang-tools-extra -y | |
- name: Check clang-format compliance | |
run: | | |
clang-format --version | |
files=$(find . -name "*.hpp" -o -name "*.cpp" -o -name "*.inl") | |
clang-format -Werror -dry-run $files |