-
Notifications
You must be signed in to change notification settings - Fork 3
chore: add GitHub Actions CI/CD workflows #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
80e472c
ci: add static analysis workflow with Cppcheck
AhmedSobhy01 9620bee
build: add GitHub Actions build workflow configuration
AhmedSobhy01 3ded30b
ci: add format check workflow for pull requests
AhmedSobhy01 89fa34b
ci: add OpenGL shader validation workflow
AhmedSobhy01 97a1d26
chore: add GitHub labeler configuration files
AhmedSobhy01 2a27617
ci(opengl): simplify shader validation output handling
AhmedSobhy01 c6cd977
fix: resolve vec3 to vec4 assignment error in fragment shader
AhmedSobhy01 51d6068
style: apply clang-format
AhmedSobhy01 be9c6e8
feat: add GitHub Actions workflow for release process
AhmedSobhy01 5dc0104
ci: update static analysis workflow configuration
AhmedSobhy01 26a66e5
ci: update static analysis workflow configuration
AhmedSobhy01 2a49670
ci: simplify shader validation in GitHub Actions workflow
AhmedSobhy01 f868328
ci: update file glob patterns in labeler configuration
AhmedSobhy01 fd45610
ci: remove unnecessary path from OpenGL workflow triggers
AhmedSobhy01 5556c17
ci: add OS matrix for build jobs in workflows
AhmedSobhy01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| 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/**" | ||
|
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" | ||
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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." |
This file contains hidden or 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
| 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 }} |
This file contains hidden or 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
| 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/**" | ||
|
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 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.