forked from omeryusufyagci/fast-music-remover
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into reorganize-BE-v1.0
*Task: Merge all the changes
- Loading branch information
Showing
29 changed files
with
973 additions
and
193 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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,52 @@ | ||
name: Build, Test and Format Core | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y ffmpeg cmake nlohmann-json3-dev libsndfile1-dev g++ | ||
- name: Build with Tests Enabled | ||
run: | | ||
mkdir -p build | ||
cd build | ||
cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release ../MediaProcessor | ||
make -j$(nproc) | ||
- name: Run Tests | ||
run: | | ||
cd build | ||
ctest --output-on-failure | ||
format: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: sudo apt update && sudo apt install -y clang-format | ||
|
||
- name: Run clang-format Check on MediaProcessor | ||
run: | | ||
find MediaProcessor/src -regex '.*\.\(cpp\|h\)' -exec clang-format --dry-run --Werror {} + | ||
- name: Display Message if Formatting Fails | ||
if: failure() | ||
run: echo "Code formatting issues found in MediaProcessor. Please run clang-format to fix them." |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
.github/workflows/pep8-check.yml → .github/workflows/format_backend.yml
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Code Formatting Check | ||
name: Backend Formatter | ||
|
||
on: | ||
push: | ||
|
This file contains 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
This file contains 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
This file contains 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,21 @@ | ||
# CMake configuration for building the main MediaProcessor executable | ||
|
||
add_executable(MediaProcessor | ||
${CMAKE_SOURCE_DIR}/src/main.cpp | ||
${CMAKE_SOURCE_DIR}/src/ConfigManager.cpp | ||
${CMAKE_SOURCE_DIR}/src/AudioProcessor.cpp | ||
${CMAKE_SOURCE_DIR}/src/VideoProcessor.cpp | ||
${CMAKE_SOURCE_DIR}/src/Utils.cpp | ||
${CMAKE_SOURCE_DIR}/src/CommandBuilder.cpp | ||
${CMAKE_SOURCE_DIR}/src/HardwareUtils.cpp | ||
${CMAKE_SOURCE_DIR}/src/FFmpegSettingsManager.cpp | ||
${CMAKE_SOURCE_DIR}/src/DeepFilterCommandBuilder.cpp | ||
) | ||
|
||
target_link_libraries(MediaProcessor PRIVATE Threads::Threads) | ||
target_link_libraries(MediaProcessor PRIVATE ${CMAKE_SOURCE_DIR}/lib/libdf.so) | ||
target_link_libraries(MediaProcessor PRIVATE ${SNDFILE_LIBRARIES}) | ||
|
||
set_target_properties(MediaProcessor PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" | ||
) |
This file contains 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,71 @@ | ||
include(FetchContent) | ||
cmake_policy(SET CMP0135 NEW) # Use the latest policy for FetchContent consistency | ||
|
||
find_package(GTest QUIET) | ||
if(NOT GTEST_FOUND) | ||
# Fetch GTest if not found | ||
FetchContent_Declare( | ||
googletest | ||
URL https://github.com/google/googletest/archive/5376968f6948923e2411081fd9372e71a59d8e77.zip | ||
DOWNLOAD_EXTRACT_TIMESTAMP TRUE | ||
) | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
endif() | ||
|
||
# Setup test media directory | ||
set(TEST_MEDIA_DIR "${CMAKE_SOURCE_DIR}/tests/TestMedia" CACHE PATH "Path to test media files") | ||
|
||
# Common libraries for all test targets | ||
set(COMMON_LIBRARIES gtest_main ${CMAKE_SOURCE_DIR}/lib/libdf.so ${SNDFILE_LIBRARIES}) | ||
|
||
# Macro for adding a test executable | ||
macro(add_test_executable name) | ||
add_executable(${name} ${ARGN}) | ||
target_compile_definitions(${name} PRIVATE TEST_MEDIA_DIR="${TEST_MEDIA_DIR}") | ||
target_link_libraries(${name} PRIVATE ${COMMON_LIBRARIES}) | ||
add_test(NAME ${name} COMMAND ${name}) | ||
endmacro() | ||
|
||
# Add test executables using the macro | ||
add_test_executable(ConfigManagerTester | ||
${CMAKE_SOURCE_DIR}/tests/ConfigManagerTester.cpp | ||
${CMAKE_SOURCE_DIR}/src/ConfigManager.cpp | ||
${CMAKE_SOURCE_DIR}/src/CommandBuilder.cpp | ||
${CMAKE_SOURCE_DIR}/src/HardwareUtils.cpp | ||
${CMAKE_SOURCE_DIR}/src/Utils.cpp | ||
${CMAKE_SOURCE_DIR}/tests/TestUtils.cpp | ||
) | ||
|
||
add_test_executable(UtilsTester | ||
${CMAKE_SOURCE_DIR}/tests/UtilsTester.cpp | ||
${CMAKE_SOURCE_DIR}/src/Utils.cpp | ||
${CMAKE_SOURCE_DIR}/src/CommandBuilder.cpp | ||
) | ||
|
||
add_test_executable(AudioProcessorTester | ||
${CMAKE_SOURCE_DIR}/tests/AudioProcessorTester.cpp | ||
${CMAKE_SOURCE_DIR}/src/AudioProcessor.cpp | ||
${CMAKE_SOURCE_DIR}/src/CommandBuilder.cpp | ||
${CMAKE_SOURCE_DIR}/src/Utils.cpp | ||
${CMAKE_SOURCE_DIR}/src/HardwareUtils.cpp | ||
${CMAKE_SOURCE_DIR}/src/ConfigManager.cpp | ||
${CMAKE_SOURCE_DIR}/tests/TestUtils.cpp | ||
) | ||
|
||
add_test_executable(VideoProcessorTester | ||
${CMAKE_SOURCE_DIR}/tests/VideoProcessorTester.cpp | ||
${CMAKE_SOURCE_DIR}/src/VideoProcessor.cpp | ||
${CMAKE_SOURCE_DIR}/src/CommandBuilder.cpp | ||
${CMAKE_SOURCE_DIR}/src/Utils.cpp | ||
${CMAKE_SOURCE_DIR}/src/ConfigManager.cpp | ||
${CMAKE_SOURCE_DIR}/src/HardwareUtils.cpp | ||
${CMAKE_SOURCE_DIR}/tests/TestUtils.cpp | ||
) | ||
|
||
add_test_executable(CommandBuilderTester | ||
${CMAKE_SOURCE_DIR}/tests/CommandBuilderTester.cpp | ||
${CMAKE_SOURCE_DIR}/src/CommandBuilder.cpp | ||
${CMAKE_SOURCE_DIR}/src/Utils.cpp | ||
) | ||
|
Oops, something went wrong.