diff --git a/.github/workflows/distro-ci.yml b/.github/workflows/distro-ci.yml new file mode 100644 index 00000000..75c6c769 --- /dev/null +++ b/.github/workflows/distro-ci.yml @@ -0,0 +1,50 @@ +name: HyperCPU CI/CD Pipeline (build HyperCPU on different platforms) + +on: + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + container: hyperwin/hcpu-ci:${{ matrix.config.tag }} + name: "Build on ${{matrix.config.name}}" + strategy: + matrix: + config: + - tag: fedora + name: Fedora + - tag: debian-stable + name: Debian Stable + - tag: debian-unstable + name: Debian Unstable + - tag: archlinux + name: Arch Linux + - tag: gentoo-glibc + name: Gentoo GLibc + - tag: gentoo-musl + name: Gentoo Musl + - tag: alpine + name: Alpine + - tag: ubuntu + name: Ubuntu + + steps: + - run: | + set -e + DISTRO=$( cat /etc/*-release | tr [:upper:] [:lower:] | grep -Poi '(debian|ubuntu|fedora|gentoo|alpine)' | uniq ) + if [ "$DISTRO" == "gentoo" ]; then source /etc/profile; fi + git clone https://github.com/HyperWinX/HyperCPU.git --recursive && cd HyperCPU + git switch "${{ github.head_ref }}" + cd dist/pog && git pull origin master && cd ../.. + cmake -S. -Bbuild -DHCPU_COMPILER=clang -DHCPU_LTO=ON -DHCPU_SANITIZERS=OFF -DCMAKE_BUILD_TYPE=Release + cmake --build build --target run-all-tests-github -j8 + cmake --build build --target default -j8 + rm -rf build + cmake -S. -Bbuild -DHCPU_COMPILER=gcc -DHCPU_LTO=ON -DHCPU_SANITIZERS=OFF -DCMAKE_BUILD_TYPE=Release + cmake --build build --target run-all-tests-github -j8 + cmake --build build --target default -j8 diff --git a/CMakeLists.txt b/CMakeLists.txt index c2b401b2..45a811a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(ROOT_DIR ${HyperCPU_SOURCE_DIR}) set(BENCHMARK_ENABLE_GTEST_TESTS OFF) # Disable gtest requirement for google/benchmark +set(FMT_SYSTEM_HEADER ON) # Fix -Wstrinop-overflow warning set_compile_flags() diff --git a/README.md b/README.md index 40e6f32f..40d3280e 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,15 @@ To display program version and exit: $ ./hcemul --version ``` +### Build status +## Supported Distributions + +| Distribution | Build Status | +|-----------------|--------------| +| Fedora | [![Fedora Build Status](https://img.shields.io/github/actions/workflow/status/HyperWinX/HyperCPU/distro-ci.yml?label=Fedora&jobName=Build-Fedora)](https://github.com/HyperWinX/HyperCPU/actions/workflows/distro-ci.yml) | +| Debian Stable | [![Debian Stable Build Status](https://img.shields.io/github/actions/workflow/status/HyperWinX/HyperCPU/distro-ci.yml?label=Debian%20Stable&jobName=Build-Debian-Stable)](https://github.com/HyperWinX/HyperCPU/actions/workflows/distro-ci.yml) | +| Debian Unstable | [![Debian Unstable Build Status](https://img.shields.io/github/actions/workflow/status/HyperWinX/HyperCPU/distro-ci.yml?label=Debian%20Unstable&jobName=Build-Debian-Unstable)](https://github.com/HyperWinX/HyperCPU/actions/workflows/distro-ci.yml) | + ### Contributing HyperCPU is in active development and we will be happy to hear any feedback from you. Do not hesitate to report bugs or suggest any ideas using "Issues" page. diff --git a/a.out b/a.out deleted file mode 100755 index ef3e4e00..00000000 Binary files a/a.out and /dev/null differ diff --git a/cmake/Variables.cmake b/cmake/Variables.cmake index 06c849a9..01f0aec8 100644 --- a/cmake/Variables.cmake +++ b/cmake/Variables.cmake @@ -3,5 +3,5 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(LTO_FLAG "-flto") endif() -set(DEBUG_COMPILE_FLAGS -Wall -Wextra -Werror -Wno-pointer-arith -O0 -ggdb3 -Wno-unused-const-variable -Wno-missing-field-initializers) -set(FAST_COMPILE_FLAGS -Wall -Wextra -Werror -Wno-pointer-arith -O3 -Wno-unused-const-variable -Wno-missing-field-initializers) +set(DEBUG_COMPILE_FLAGS -Wall -Wextra -Werror -Wno-pointer-arith -O0 -ggdb3 -Wno-unused-const-variable -Wno-missing-field-initializers -Wno-stringop-overflow -Wno-unknown-warning-option) +set(FAST_COMPILE_FLAGS -Wall -Wextra -Werror -Wno-pointer-arith -O3 -Wno-unused-const-variable -Wno-missing-field-initializers -Wno-stringop-overflow -Wno-unknown-warning-option) diff --git a/dist/pog b/dist/pog index d2673b7a..d62f0d05 160000 --- a/dist/pog +++ b/dist/pog @@ -1 +1 @@ -Subproject commit d2673b7a269bc37db1810726466de0d6294ba911 +Subproject commit d62f0d05c1cbb638ef2d4d37084ab8b54e3bfc29 diff --git a/src/Emulator/Core/CPU/IO/Simple.cpp b/src/Emulator/Core/CPU/IO/Simple.cpp index a48e533b..a1cbb195 100644 --- a/src/Emulator/Core/CPU/IO/Simple.cpp +++ b/src/Emulator/Core/CPU/IO/Simple.cpp @@ -53,7 +53,7 @@ void HyperCPU::SimpleIOImpl::Putchar(std::uint8_t c) { std::uint8_t HyperCPU::SimpleIOImpl::Getchar() { char c; - read(STDIN_FILENO, &c, 1); + [[maybe_unused]] auto t = read(STDIN_FILENO, &c, 1); return c; } diff --git a/test.cpp b/test.cpp deleted file mode 100644 index 7559add8..00000000 --- a/test.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - -int main() { - srand(time(0)); - int a = rand(); - int b = rand(); - - if (a > b) return 1; - else if (a < b) return 2; - else return 0; -} diff --git a/test/fixtures.hpp b/test/fixtures.hpp index dbeacb7c..17a6dcad 100644 --- a/test/fixtures.hpp +++ b/test/fixtures.hpp @@ -27,11 +27,11 @@ class TempDir { dir_name = "test_"; dir_name += test_name; std::filesystem::create_directory(dir_name); - chdir(dir_name.c_str()); + [[maybe_unused]] auto t = chdir(dir_name.c_str()); } ~TempDir() { - chdir(".."); + [[maybe_unused]] auto t = chdir(".."); try { std::filesystem::remove_all(dir_name); } catch (std::filesystem::filesystem_error&) { }