Skip to content
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
50 changes: 50 additions & 0 deletions .github/workflows/distro-ci.yml
Original file line number Diff line number Diff line change
@@ -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: |

Check failure on line 37 in .github/workflows/distro-ci.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/distro-ci.yml#L37

Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner.
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@
$ ./hcemul --version
```

### Build status

Check notice on line 145 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L145

Expected: 1; Actual: 0; Below
## Supported Distributions

Check notice on line 146 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L146

Expected: 1; Actual: 0; Above

| 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.
Expand Down
Binary file removed a.out
Binary file not shown.
4 changes: 2 additions & 2 deletions cmake/Variables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion dist/pog
Submodule pog updated from d2673b to d62f0d
2 changes: 1 addition & 1 deletion src/Emulator/Core/CPU/IO/Simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
12 changes: 0 additions & 12 deletions test.cpp

This file was deleted.

4 changes: 2 additions & 2 deletions test/fixtures.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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&) { }
Expand Down
Loading