diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..12e5856 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,32 @@ +## Description +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. + +## Type of Change +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Documentation update +- [ ] Refactoring (no functional change, code cleanup) +- [ ] Performance improvement + +## Code Review Process +**IMPORTANT**: This project maintains an extremely high standard for code quality and correctness. By submitting this pull request, you acknowledge and agree to the following: + +1. **You must be able to defend every single line of code you have added or modified** +2. **You must be prepared to explain the reasoning behind every design decision** +3. **You must be able to discuss and justify your approach to solving the problem** +4. **You must be ready to address all feedback and make requested changes** +5. **You must have thoroughly tested your changes and be confident in their correctness** + +The code review process for this project is intentionally tedious and thorough. Do not submit a pull request unless you are prepared to defend your PR changes. + +## Breaking Changes +If this change introduces any breaking changes, please describe them here. + +## Checklist +- [ ] My code follows the project's coding style guidelines +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have read the project's CONTRIBUTING guidelines +- [ ] I understand and agree to the rigorous code review process described above diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3fb145f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,140 @@ +name: Build + +on: [push, pull_request] + +concurrency: + group: ci-${{github.event_name}}-${{github.ref}} + cancel-in-progress: ${{github.event_name == 'push'}} + +env: + BUILD_TYPE: Release + BUILD_DIR: ${{github.workspace}}/build + +jobs: + get-info: + name: Info + runs-on: ubuntu-24.04 + outputs: + shorthash: ${{steps.vars.outputs.shorthash}} + commit: ${{steps.vars.outputs.commit}} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Commit Count and Git Hash + id: vars + run: | + echo "shorthash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "commit=$(git rev-list --count HEAD)" >> $GITHUB_ENV + echo "shorthash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "commit=$(git rev-list --count HEAD)" >> $GITHUB_OUTPUT + + Linux: + name: Linux + runs-on: ubuntu-24.04 + needs: get-info + steps: + - uses: actions/checkout@v5 + with: + submodules: recursive + fetch-depth: 0 + + - name: Install Dependencies + run: | + sudo apt update + sudo apt-get remove --purge man-db + sudo apt install -y ninja-build clang lld cmake ccache \ + libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ + libxi-dev libxinerama-dev libwayland-dev libxkbcommon-dev \ + wayland-protocols libgl-dev git + + - name: Configure CMake + run: cmake -G Ninja -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + + - name: Build + run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} --parallel $(nproc) + + + Windows: + name: Windows + runs-on: windows-2025 + needs: get-info + steps: + - uses: actions/checkout@v5 + with: + submodules: recursive + fetch-depth: 0 + + - name: Configure CMake + run: + cmake -G Ninja -B "${{env.BUILD_DIR}}" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ` + -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl ` + -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + + - name: Build + run: cmake --build "${{env.BUILD_DIR}}" --config ${{env.BUILD_TYPE}} --parallel $env:NUMBER_OF_PROCESSORS + + macOS-x86_64: + name: macOS x86_64 + runs-on: macos-15-intel + needs: get-info + steps: + - uses: actions/checkout@v5 + with: + submodules: recursive + fetch-depth: 0 + + - name: Setup latest Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Install Dependencies + run: | + brew install llvm@20 + echo "CMAKE_PREFIX_PATH=/usr/local/opt/llvm@20" >> $GITHUB_ENV + + - name: Configure CMake (x86_64) + run: > + cmake -G Ninja -B "${{env.BUILD_DIR}}" + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DCMAKE_OSX_ARCHITECTURES=x86_64 + -DCMAKE_C_COMPILER=/usr/local/opt/llvm@20/bin/clang + -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@20/bin/clang++ + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 + + - name: Build (x86_64) + run: cmake --build "${{env.BUILD_DIR}}" --config ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.logicalcpu) + + macOS-arm64: + name: macOS ARM64 + runs-on: macos-14 + needs: get-info + steps: + - uses: actions/checkout@v5 + with: + submodules: recursive + fetch-depth: 0 + + - name: Setup latest Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Install Dependencies + run: | + brew install llvm@20 + echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/llvm@20" >> $GITHUB_ENV + + - name: Configure CMake (ARM64) + run: > + cmake -G Ninja -B "${{env.BUILD_DIR}}" + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@20/bin/clang + -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@20/bin/clang++ + -DCMAKE_OSX_ARCHITECTURES=arm64 + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 + + - name: Build (ARM64) + run: cmake --build "${{env.BUILD_DIR}}" --config ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.logicalcpu) +