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

为 SimplePhysicsEngine 添加软体仿真 #29

Merged
merged 18 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
53 changes: 50 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
sudo apt update
sudo apt install --fix-missing -y doxygen graphviz clang-format clang-tidy cppcheck lcov
sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev libvtk9-dev qtbase5-dev xorg-dev libglu1-mesa-dev libglm-dev libglfw3-dev
sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev libvtk9-dev qtbase5-dev xorg-dev libglu1-mesa-dev libglm-dev libglfw3-dev libglew-dev

- name: Build
run: |
Expand All @@ -48,14 +48,33 @@ jobs:
run: |
sudo apt update
sudo apt install --fix-missing -y doxygen graphviz clang-format clang-tidy cppcheck lcov
sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev libvtk9-dev qtbase5-dev xorg-dev libglu1-mesa-dev libglm-dev libglfw3-dev
sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev libvtk9-dev qtbase5-dev xorg-dev libglu1-mesa-dev libglm-dev libglfw3-dev libglew-dev
sudo apt-get install --no-install-recommends -y xvfb

- name: Build
run: |
cmake --preset=build
cmake --build build --target all
cmake --build build --target coverage

- name: Start Xvfb
run: |
nohup Xvfb :99 -screen 0 1024x768x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV

- name: Run demo2d
run: |
for i in {1..7}; do
./build/bin/demo2d --test --instruction $i
done
env:
DISPLAY: :99

- name: Run MassSpring3D
run: ./build/bin/MassSpring3D --test --instruction 1
env:
DISPLAY: :99

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
Expand All @@ -69,13 +88,41 @@ jobs:

- name: Install dependencies
run: |
brew install doxygen graphviz llvm cppcheck lcov spdlog boost freeglut glfw vtk cgal glm
brew install doxygen graphviz llvm cppcheck lcov spdlog boost freeglut glfw glew vtk cgal glm
ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"

- name: Install XQuartz
run: |
brew install --cask xquartz

- name: Start Xvfb
run: |
sudo Xvfb :99 -screen 0 1024x768x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV

- name: Build
run: |
cmake --preset=build
cmake --build build --target all

- name: Run demo2d
run: |
for i in {1..7}; do
./build/bin/demo2d --test --instruction $i
done
env:
DISPLAY: :99

- name: Run MassSpring3D
run: ./build/bin/MassSpring3D --test --instruction 1
env:
DISPLAY: :99

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: build/coverage/coverage.info
verbose: true
# @bug 在 osx 下无法正常执行 lcov
# cmake --build build --target coverage
2 changes: 1 addition & 1 deletion cmake/3rd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ find_package(glfw3 REQUIRED)
if (NOT glfw3_FOUND)
message(FATAL_ERROR "glfw3 not found.\n"
"Following https://www.glfw.org to install.")
endif ()
endif ()
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ packageProject(
# 生成文件目录
BINARY_DIR ${PROJECT_BINARY_DIR}
# 头文件路径
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src/include ${PROJECT_SOURCE_DIR}/src/math/include ${PROJECT_SOURCE_DIR}/src/physics/include
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src/include ${PROJECT_SOURCE_DIR}/src/collision_detect/include ${PROJECT_SOURCE_DIR}/src/math/include ${PROJECT_SOURCE_DIR}/src/physics/include
# 与 target 的 INSTALL_INTERFACE 一致
INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION}
# 头文件过滤
Expand Down Expand Up @@ -120,7 +120,7 @@ packageProject(
# 生成文件目录
BINARY_DIR ${PROJECT_BINARY_DIR}
# 头文件路径
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src/include ${PROJECT_SOURCE_DIR}/src/math/include ${PROJECT_SOURCE_DIR}/src/physics/include
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src/include ${PROJECT_SOURCE_DIR}/src/collision_detect/include ${PROJECT_SOURCE_DIR}/src/math/include ${PROJECT_SOURCE_DIR}/src/physics/include
# 与 target 的 INSTALL_INTERFACE 一致
INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION}
# 头文件过滤
Expand Down
Loading
Loading