diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 1b30d15..c6d557c 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -1,10 +1,10 @@ -name: CMake +name: unix-ci on: push: - branches: [ "master" ] + branches: [ "master", "develop" ] pull_request: - branches: [ "master" ] + branches: [ "master", "develop" ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -16,41 +16,60 @@ env: echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest - + build-tests: + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [ubuntu-latest, ubuntu-22.04, ubuntu-20.04, macos-latest, macos-12, macos-11] + rmq: [WITH_RMQ=ON, WITH_RMQ=OFF] steps: - - name: set apt conf + - name: set apt conf (Debian based Linux) + if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-20.04' run: ${{env.APT_SET_CONF}} - - name: update apt + - name: update apt (Debian based Linux) + if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-20.04' run: sudo apt update - - name: install monero dependencies + - name: Install dependencies (Debian based Linux) + if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-20.04' run: ${{env.APT_INSTALL_LINUX}} + - name: Install RabbitMQ iff WITH_RMQ (Debian based Linux) + if: matrix.rmq == 'WITH_RMQ=ON' && (matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-20.04') + run: sudo apt -y install librabbitmq-dev + + - name: Install dependencies (MacOS) + if: matrix.os == 'macos-latest' || matrix.os == 'macos-12' || matrix.os == 'macos-11' + run: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi openssl zmq libpgm miniupnpc expat libunwind-headers protobuf ccache + - name: Install RabbitMQ iff WITH_RMQ (MacOS) + if: matrix.rmq == 'WITH_RMQ=ON' && (matrix.os == 'macos-latest' || matrix.os == 'macos-12' || matrix.os == 'macos-11') + run: HOMEBREW_NO_AUTO_UPDATE=1 brew install rabbitmq-c - - uses: actions/checkout@v3 + - name: Checkout Monero Source + uses: actions/checkout@v3 with: repository: monero-project/monero path: ${{github.workspace}}/monero/ - + submodules: recursive + - name: Configure Monero run: cmake -B ${{github.workspace}}/monero/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/monero - + - name: Build Monero - run: cd ${{github.workspace}}/monero/build && make daemon lmdb_lib multisig - - - uses: actions/checkout@v3 + run: cd ${{github.workspace}}/monero/build && make -j$(nproc) daemon lmdb_lib multisig + + - name: Checkout LWS Source + uses: actions/checkout@v3 with: path: ${{github.workspace}}/lws - 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}}/lws/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMONERO_SOURCE_DIR=${{github.workspace}}/monero -DMONERO_BUILD_DIR=${{github.workspace}}/monero/build ${{gitub.workspace}}/lws + run: cmake -B ${{github.workspace}}/lws/build -D${{matrix.rmq}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMONERO_SOURCE_DIR=${{github.workspace}}/monero -DMONERO_BUILD_DIR=${{github.workspace}}/monero/build ${{github.workspace}}/lws -DBUILD_TESTS=ON - name: Build LWS # Build your program with the given configuration - run: cd ${{github.workspace}}/lws/build && make + run: (cd ${{github.workspace}}/lws/build && make -j$(nproc)) + + - name: Run Tests + run: cd ${{github.workspace}}/lws/build && ctest