Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/labeler.yml
Comment thread
LoayAhmed304 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
shader:
- changed-files:
- any-glob-to-any-file: "src/common/shader/**"
Comment thread
AhmedSobhy01 marked this conversation as resolved.
Outdated

mesh:
- changed-files:
- any-glob-to-any-file: "src/common/mesh/**"

texture:
- changed-files:
- any-glob-to-any-file: "src/common/texture/**"

material:
- changed-files:
- any-glob-to-any-file: "src/common/material/**"

ecs:
- changed-files:
- any-glob-to-any-file: "src/common/ecs/**"

components:
- changed-files:
- any-glob-to-any-file: "src/common/components/**"

renderer:
- changed-files:
- any-glob-to-any-file: "src/common/systems/**"

core:
- changed-files:
- any-glob-to-any-file:
- "src/common/application.*"
- "src/common/asset-loader.*"
- "src/main.cpp"

config:
- changed-files:
- any-glob-to-any-file: "config/**"

tests:
- changed-files:
- any-glob-to-any-file:
- "src/states/*-test-*"
- "config/*-test/**"
- "expected/**"

build:
- changed-files:
- any-glob-to-any-file:
- "CMakeLists.txt"
- "justfile"
- "flake.nix"
- "flake.lock"
- ".github/workflows/**"

docs:
- changed-files:
- any-glob-to-any-file:
- "docs/**"
- "**/*.md"

assets:
- changed-files:
- any-glob-to-any-file: "assets/**"

vendor:
- changed-files:
- any-glob-to-any-file:
- "vendor/**"
- ".gitmodules"
76 changes: 76 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build

on:
push:
branches: [main]
paths-ignore:
- "docs/**"
- "**.md"
- ".agent/**"
- ".editorconfig"
pull_request:
branches: [main]
paths-ignore:
- "docs/**"
- "**.md"
- ".agent/**"
- ".editorconfig"

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu / GCC
os: ubuntu-latest
generator: Ninja
shell: bash
- name: Windows / MSVC
os: windows-latest
generator: "Visual Studio 17 2022"
shell: pwsh

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
cmake ninja-build \
libgl1-mesa-dev \
libx11-dev libxrandr-dev libxi-dev \
libxinerama-dev libxcursor-dev

- name: Cache build directory
uses: actions/cache@v4
with:
path: build
key: build-${{ matrix.os }}-${{ hashFiles('CMakeLists.txt', 'src/**') }}
restore-keys: |
build-${{ matrix.os }}-

- name: Configure (Debug)
run: >
cmake -S . -B build
-G "${{ matrix.generator }}"
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_COLOR_DIAGNOSTICS=ON
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
shell: bash

- name: Build
run: cmake --build build --config Debug -j 4
shell: bash
48 changes: 48 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Format Check

on:
pull_request:
branches: [main]
paths:
- "src/**"

jobs:
clang-format:
name: clang-format
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format

- name: Check formatting
run: |
FAILED=0
FILES=$(find src/ -type f \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \))

for file in $FILES; do
# Generate the diff between current and formatted versions
DIFF=$(clang-format "$file" | diff -u "$file" - || true)
if [ -n "$DIFF" ]; then
echo "::error file=$file::File is not formatted according to .clang-format"
echo "$DIFF"
echo ""
FAILED=1
fi
done

if [ "$FAILED" -eq 1 ]; then
echo ""
echo "Some files are not properly formatted."
echo ""
echo "Fix locally with:"
echo ' find src/ -type f \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \) | xargs clang-format -i'
exit 1
fi

echo "All files are properly formatted."
18 changes: 18 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR Labeler

on:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write

jobs:
labeler:
name: Auto-label PR
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/opengl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: OpenGL

on:
push:
branches: [main]
paths:
- "src/**"
- "assets/shaders/**"
- "config/**"
- "expected/**"
Comment thread
AhmedSobhy01 marked this conversation as resolved.
Outdated
pull_request:
branches: [main]
paths:
- "src/**"
- "assets/shaders/**"
- "config/**"
- "expected/**"

concurrency:
group: opengl-${{ github.ref }}
cancel-in-progress: true

jobs:
shader-validation:
name: Shader Validation
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install glslang
run: sudo apt-get update && sudo apt-get install -y glslang-tools

- name: Validate GLSL shaders
run: |
SHADERS=$(find assets/shaders -type f \( -name "*.vert" -o -name "*.frag" -o -name "*.geom" -o -name "*.comp" \))
echo "Found $(echo "$SHADERS" | wc -l) shaders"
echo "$SHADERS" | xargs glslangValidator
Loading
Loading