Skip to content
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

Workflow #6

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 21 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
24 changes: 24 additions & 0 deletions .github/workflows/clang-tidy-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: clang-tidy-review

# You can be more specific, but it currently only works on pull requests
on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Optionally generate compile_commands.json

- uses: ZedThree/[email protected]
id: review

# Uploads an artefact containing clang_fixes.json
- uses: ZedThree/clang-tidy-review/[email protected]
id: upload-review

# If there are any comments, fail the check
- if: steps.review.outputs.total_comments > 0
run: exit 1
128 changes: 56 additions & 72 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,86 +1,70 @@
name: Compile

name: main-before

on:
on:
merge_group:
pull_request:

# linux-gcc
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-latest
compiler: gcc
generator: Ninja
deps_cmdline: sudo apt-get update && sudo apt-get -y install gcc cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev
- os: ubuntu-latest
compiler: clang
generator: Ninja
deps_cmdline: sudo apt-get update && sudo apt-get -y install clang cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev
- os: windows-latest
compiler: msvc
generator: Visual Studio 17 2022
- os: windows-latest
compiler: mingw
generator: MinGW Makefiles
- os: macos-latest
compiler: clang
generator: Ninja
deps_cmdline: brew install cmake ninja mesa-glu mesa xorg-server

- name: Installing Dependencies
run: |
sudo apt-get update
sudo apt-get -y install gcc cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev
steps:
- if: matrix.config.os == 'windows-latest' && matrix.config.compiler == 'mingw'
name: "Set Windows-MinGW-Compiler"
uses: seanmiddleditch/gha-setup-ninja@master

- name: Checkout Repository
uses: actions/checkout@v3
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
submodules: recursive

- name: Building Project
if: matrix.os == 'ubuntu-latest'
env:
CC: gcc
CXX: g++
- name: Install Dependencies
shell: bash
run: |
cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build

# jobs:
# build:
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest]
# compiler: [{ cc: gcc, cxx: g++ }, { cc: clang, cxx: clang++ }]
# build_type: [Debug]
# binary: [linux-binary]
# include:
# - os: windows-latest
# build_type: Debug
# binary: windows-binary

# steps:
# - if: matrix.os == 'ubuntu-latest'
# name: Installing Dependencies
# run: |
# sudo apt-get update
# sudo apt-get -y install ${{ matrix.compiler.cc }} cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev

# - name: Checkout Repository
# uses: actions/checkout@v3
# with:
# submodules: recursive
if [[ ! -z "${{ matrix.config.deps_cmdline }}" ]]; then
eval ${{ matrix.config.deps_cmdline }}
fi

# - name: Check Format
# if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'clang'
# run: |
# find src/ include/ test/ assets/shaders/ -name "*.*" -print0 | \
# xargs -0 clang-format --dry-run --Werror --ferror-limit=15

# - name: Building Project
# if: matrix.os == 'ubuntu-latest'
# env:
# CC: ${{ matrix.compiler.cc }}
# CXX: ${{ matrix.compiler.cxx }}
# run: |
# cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
# cmake --build build

# - name: Run Linter
# if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'clang'
# run: |
# find src/ include/ test/ -name "*.*" -print0 | \
# xargs -0 run-clang-tidy true -p build
- name: "Setup cmake"
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug -G "${{ matrix.config.generator }}"
cmake --build build

# - name: Building Project
# if: matrix.os == 'windows-latest'
# run: |
# cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
# cmake --build build --config ${{ matrix.build_type }}
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
strategy:
matrix:
path:
- "src"
- "include"
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: "18"
check-path: ${{ matrix.path }}
fallback-style: "Mozilla" # optional
16 changes: 7 additions & 9 deletions .github/workflows/multi_system.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

name: main

on:
on:
merge_group:
pull_request:

jobs:

windows-visual-studio:
runs-on: windows-latest
steps:
Expand All @@ -21,10 +19,11 @@ jobs:
submodules: recursive

- name: "Setup cmake"

run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build

windows-mingw:
runs-on: windows-latest
steps:
Expand All @@ -35,7 +34,7 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive

- name: "Build"
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles"
Expand All @@ -49,12 +48,11 @@ jobs:
- name: "Setup required packages"
run: brew install cmake ninja mesa-glu mesa xorg-server


- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Building Project
run: |
cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Debug
Expand All @@ -77,15 +75,15 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive

- name: Building Project
env:
CC: clang
CXX: clang++
run: |
cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Debug
cmake --build build

linux-gcc:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# Doxygen's file
doxydoc/

# some plugins
3rdparty/

# User-specific stuff
Expand Down
11 changes: 11 additions & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PROJECT_NAME = "something"
OUTPUT_DIRECTORY = ./doxydoc/
BUILTIN_STL_SUPPORT = YES
EXTRACT_ALL = YES
INPUT = ./src ./include
RECURSIVE = YES
HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES
UML_LOOK = YES
CALL_GRAPH = YES
CALLER_GRAPH = YES
4 changes: 3 additions & 1 deletion cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ FetchContent_Declare(
PTSD
GIT_REPOSITORY https://github.com/NTUT-FUCK-PTSD/practical-tools-for-simple-design.git
GIT_TAG v1.2.5
URL_HASH MD5=c3e956114176a1cd8903b84f326d12c9
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/PTSD
)
FetchContent_MakeAvailable(PTSD)
Expand All @@ -33,7 +34,6 @@ message(STATUS "soloud NOT FOUND, fetching from source!")
FetchContent_Declare(
soloud
GIT_REPOSITORY https://github.com/onon1101/soloud.git
# GIT_TAG noinst
GIT_TAG onon1101-patch-2

SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/soloud
Expand All @@ -42,6 +42,8 @@ FetchContent_Declare(
FetchContent_GetProperties(soloud)
if (NOT soloud_POPULATED)
FetchContent_Populate(soloud)

set(SDL2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/PTSD/3rdparty/sdl2/include)
add_subdirectory(${soloud_SOURCE_DIR}/contrib)
endif()

Expand Down
2 changes: 1 addition & 1 deletion src/Player/Equipment/Shovel/EntityShovel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
#include "Equipment/Shovel/EntityShovel.h"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'Equipment/Shovel/EntityShovel.h' file not found [clang-diagnostic-error]

#include "Equipment/Shovel/EntityShovel.h"
         ^


ToolSystem::EntityShovel::EntityShovel()
: TBaseShovel(level, ImagePath, m_IsThrow) {};
: TBaseShovel(level, ImagePath, m_IsThrow){};
Loading