Skip to content
Open
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
58 changes: 58 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: unix-ci

on:
push:
branches: [ "master", "develop", "release-*" ]
pull_request:
branches: [ "master", "develop", "release-*" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
APT_INSTALL_LINUX: 'sudo apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libnorm-dev libusb-1.0-0-dev libpgm-dev libprotobuf-dev protobuf-compiler'
APT_SET_CONF: |
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
BREW_INSTALL_MAC: 'HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi openssl zmq libpgm miniupnpc expat libunwind-headers protobuf unbound'

jobs:
build-and-test:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: set apt conf (Debian base Linux)
if: matrix.os == 'ubuntu-latest'
run: ${{env.APT_SET_CONF}}
- name: update apt (Debian based Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt update
- name: Install dependencies (Debian based Linux)
if: matrix.os == 'ubuntu-latest'
run: ${{env.APT_INSTALL_LINUX}}
- name: Install dependencies (MacOS)
if: matrix.os == 'macos-latest'
run: ${{env.BREW_INSTALL_MAC}}
- name: Checkout Monero Source
uses: actions/checkout@v4
with:
repository: monero-project/monero
path: ${{github.workspace}}/monero/
submodules: recursive
- name: Checkout LWSF Source
uses: actions/checkout@v4
with:
path: ${{github.workspace}}/lwsf
submodules: recursive
- name: Configure LWS
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/lwsf/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMONERO_SOURCE_DIR=${{github.workspace}}/monero -DLWSF_BUILD_TESTS=ON ${{github.workspace}}/lwsf
- name: Build LWSF
# Build your program with the given configuration
run: (cd ${{github.workspace}}/lwsf/build && make -j$(nproc))
- name: Run Tests
run: cd ${{github.workspace}}/lwsf/build && ctest
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ enable_language(CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

option(LWSF_BUILD_TESTS "Build Tests" OFF)

if (NOT MONERO_SOURCE_DIR)
message(FATAL_ERROR "The argument -DMONERO_SOURCE_DIR must specify a location of a monero source tree")
endif()
Expand Down Expand Up @@ -89,4 +91,7 @@ set_property(TARGET monero::libraries PROPERTY
)

add_subdirectory(src)

if (LWSF_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
Loading