Files
wownero-lws/.github/workflows/build-ubuntu.yml
T

193 lines
7.2 KiB
YAML

name: ci
on:
push:
branches: [ "master", "develop", "release-*" ]
paths-ignore: [ "docs/**", "mkdocs.yml" ]
pull_request:
branches: [ "master", "develop", "release-*" ]
paths-ignore: [ "docs/**", "mkdocs.yml" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
APT_INSTALL_LINUX: 'apt -y install build-essential cmake git 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'
CONFIGURE_BASIC: '-B "$GITHUB_WORKSPACE/lws/build" -DMONERO_SOURCE_DIR="$GITHUB_WORKSPACE/monero" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -S "$GITHUB_WORKSPACE/lws"'
BUILD: 'cmake --build "$GITHUB_WORKSPACE/lws/build" -j$(nproc)'
RUN: 'ctest --test-dir "$GITHUB_WORKSPACE/lws/build" --output-on-failure'
jobs:
build-beginner:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Install Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
${{env.APT_SET_CONF}}
sudo apt update
sudo ${{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@v6
with:
repository: monero-project/monero
path: ${{github.workspace}}/monero/
submodules: recursive
- name: Checkout LWS Source
uses: actions/checkout@v6
with:
path: ${{github.workspace}}/lws
submodules: recursive
- name: Configure LWS
run: cmake ${{env.CONFIGURE_BASIC}}
- name: Build LWS
run: ${{env.BUILD}}
build-distro:
runs-on: ubuntu-latest
container: ${{matrix.distro}}
strategy:
fail-fast: false
matrix:
distro: [almalinux:9, almalinux:10, archlinux:base-devel, debian:bookworm-slim, debian:trixie-slim]
steps:
- name: Install Dependencies (Debian/apt)
if: matrix.distro == 'debian:bookworm-slim' || matrix.distro == 'debian:trixie-slim'
run: |
apt update
${{env.APT_INSTALL_LINUX}}
- name: Install Dependencies (Arch/pacman)
if: matrix.distro == 'archlinux:base-devel'
run: |
sudo pacman --noconfirm -Syu
sudo pacman --noconfirm -S cmake boost boost-libs git hidapi libsodium miniupnpc openssl unbound zeromq
- name: Install Dependencies (Alma/dnf)
if: matrix.distro == 'almalinux:9' || matrix.distro == 'almalinux:10'
run: |
dnf -y update
dnf -y install epel-release
dnf clean all
dnf makecache
dnf config-manager --set-enabled crb
dnf -y install boost-devel cmake gcc g++ git hidapi-devel libsodium-devel make miniupnpc-devel openssl-devel unbound-devel zeromq-devel zlib-devel
- name: Checkout Monero Source
uses: actions/checkout@v6
with:
repository: monero-project/monero
path: ${{github.workspace}}/monero/
submodules: recursive
- name: Checkout LWS Source
uses: actions/checkout@v6
with:
path: ${{github.workspace}}/lws
- name: Configure LWS
run: cmake ${{env.CONFIGURE_BASIC}}
- name: Build LWS
run: ${{env.BUILD}}
- name: Run Tests
run: ${{env.RUN}}
build-advanced:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-22.04, macos-15, macos-14]
rmq: [WITH_RMQ=ON, WITH_RMQ=OFF]
steps:
- name: Install Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-22.04'
run: |
${{env.APT_SET_CONF}}
sudo apt update
sudo ${{env.APT_INSTALL_LINUX}}
- name: Install RabbitMQ iff WITH_RMQ (Ubuntu)
if: matrix.rmq == 'WITH_RMQ=ON' && (matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-22.04')
run: sudo apt -y install librabbitmq-dev
- name: Install dependencies (MacOS)
if: matrix.os == 'macos-latest' || matrix.os == 'macos-14' || matrix.os == 'macos-15'
run: ${{env.BREW_INSTALL_MAC}}
- name: Install RabbitMQ iff WITH_RMQ (MacOS)
if: matrix.rmq == 'WITH_RMQ=ON' && (matrix.os == 'macos-latest' || matrix.os == 'macos-14' || matrix.os == 'macos-15')
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install rabbitmq-c
- name: Checkout Monero Source
uses: actions/checkout@v6
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 -j$(nproc) daemon lmdb_lib multisig
- name: Checkout LWS Source
uses: actions/checkout@v6
with:
path: ${{github.workspace}}/lws
- name: Configure LWS
run: cmake -D${{matrix.rmq}} -DMONERO_BUILD_DIR=${{github.workspace}}/monero/build ${{env.CONFIGURE_BASIC}}
- name: Build LWS
# Build your program with the given configuration
run: ${{env.BUILD}}
- name: Run Tests
run: ${{env.RUN}}
build-sanitizer-tests:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rmq: [WITH_RMQ=ON]
sanitizer: [SANITIZER=address]
steps:
- name: Install Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
${{env.APT_SET_CONF}}
sudo apt update
sudo ${{env.APT_INSTALL_LINUX}}
- name: Install RabbitMQ iff WITH_RMQ (Ubuntu)
if: matrix.rmq == 'WITH_RMQ=ON' && (matrix.os == 'ubuntu-latest')
run: sudo apt -y install librabbitmq-dev
- name: Install dependencies (MacOS)
if: matrix.os == 'macos-latest'
run: ${{env.BREW_INSTALL_MAC}}
- name: Install RabbitMQ iff WITH_RMQ (MacOS)
if: matrix.rmq == 'WITH_RMQ=ON' && (matrix.os == 'macos-latest')
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install rabbitmq-c
- name: Checkout Monero Source
uses: actions/checkout@v6
with:
repository: monero-project/monero
path: ${{github.workspace}}/monero/
submodules: recursive
- name: Checkout LWS Source
uses: actions/checkout@v6
with:
path: ${{github.workspace}}/lws
- name: Configure LWS
run: cmake -D${{matrix.rmq}} -D${{matrix.sanitizer}} ${{env.CONFIGURE_BASIC}}
- name: Build LWS
run: ${{env.BUILD}}
- name: Run Tests
run: ${{env.RUN}}