on:
push:
tags:
- - "linux-2.8.1-*"
+ - "linux-*"
jobs:
build:
- name: Ubuntu 24.04
+ name: ${{ matrix.distro }}
runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ distro: [ubuntu-24.04, fedora-latest, archlinux-latest]
+ include:
+ - distro: ubuntu-24.04
+ container: ubuntu:24.04
+ install_cmd: |
+ export DEBIAN_FRONTEND=noninteractive
+ apt update
+ apt -y install git cmake build-essential ccache libssl-dev libunbound-dev libboost-all-dev \
+ libqrencode-dev qt6-base-dev qt6-svg-dev qt6-websockets-dev qt6-multimedia-dev \
+ qt6-wayland-dev libzip-dev libsodium-dev libgcrypt20-dev libx11-xcb-dev \
+ protobuf-compiler libprotobuf-dev libhidapi-dev libzxing-dev libusb-dev \
+ libusb-1.0-0-dev pkg-config
+ - distro: fedora-latest
+ container: fedora:latest
+ install_cmd: |
+ dnf -y update
+ dnf -y install git cmake make gcc-c++ ccache openssl-devel libunbound-devel boost-devel \
+ qrencode-devel qt6-qtbase-devel qt6-qtsvg-devel qt6-qtwebsockets-devel \
+ qt6-qtmultimedia-devel qt6-qtwayland-devel libzip-devel libsodium-devel \
+ libgcrypt-devel libxcb-devel protobuf-compiler protobuf-devel hidapi-devel \
+ zxing-cpp-devel libusb1-devel systemd-devel
+ - distro: archlinux-latest
+ container: archlinux:latest
+ install_cmd: |
+ pacman -Syu --noconfirm
+ pacman -S --noconfirm git cmake base-devel ccache openssl libunbound boost qrencode \
+ qt6-base qt6-svg qt6-websockets qt6-multimedia qt6-wayland \
+ libzip libsodium libgcrypt libxcb protobuf hidapi zxing-cpp libusb
+
container:
- image: ubuntu:24.04
+ image: ${{ matrix.container }}
+
+ env:
+ CCACHE_DIR: /github/home/.ccache
+
steps:
- name: Install dependencies
- run: |
- export DEBIAN_FRONTEND=noninteractive
- apt update
- apt -y install git cmake build-essential libssl-dev libunbound-dev libboost-all-dev \
- libqrencode-dev qt6-base-dev qt6-svg-dev qt6-websockets-dev qt6-multimedia-dev \
- qt6-wayland-dev libzip-dev libsodium-dev libgcrypt20-dev libx11-xcb-dev \
- protobuf-compiler libprotobuf-dev libhidapi-dev libzxing-dev libusb-dev \
- libusb-1.0-0-dev
+ run: ${{ matrix.install_cmd }}
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
+ - name: Setup ccache
+ uses: actions/cache@v4
+ with:
+ path: ${{ env.CCACHE_DIR }}
+ key: ${{ matrix.distro }}-ccache-${{ github.sha }}
+ restore-keys: |
+ ${{ matrix.distro }}-ccache-
+
- name: Configure CMake
- run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
+ run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build build -j $(nproc)
build:
name: macOS (brew)
runs-on: macos-latest
+ steps:
+ env:
+ CCACHE_DIR: /Users/runner/Library/Caches/ccache
+
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
brew update
- brew install --quiet qt libsodium libzip qrencode unbound cmake boost hidapi openssl expat protobuf pkg-config
+ brew install --quiet qt libsodium libzip qrencode unbound cmake boost hidapi openssl expat protobuf pkg-config ccache
+
+ - name: Setup ccache
+ uses: actions/cache@v4
+ with:
+ path: ${{ env.CCACHE_DIR }}
+ key: macos-ccache-${{ github.sha }}
+ restore-keys: |
+ macos-ccache-
- name: Configure CMake
- run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWITH_SCANNER=OFF
+ run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWITH_SCANNER=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build build -j $(sysctl -n hw.ncpu)
build:
name: Windows (MSYS2)
runs-on: windows-latest
+ steps:
+ env:
+ CCACHE_DIR: ~/.ccache
+
steps:
- name: Checkout repository
uses: actions/checkout@v4
mingw-w64-x86_64-qt6-websockets
mingw-w64-x86_64-qt6-multimedia
mingw-w64-x86_64-zxing-cpp
+ mingw-w64-x86_64-ccache
+
+ - name: Setup ccache
+ uses: actions/cache@v4
+ with:
+ path: ${{ env.CCACHE_DIR }}
+ key: win-ccache-${{ github.sha }}
+ restore-keys: |
+ win-ccache-
- name: Build
shell: msys2 {0}
run: |
- cmake -G "MinGW Makefiles" -S . -B build -DCMAKE_BUILD_TYPE=Release -DWITH_SCANNER=OFF
+ cmake -G "MinGW Makefiles" -S . -B build -DCMAKE_BUILD_TYPE=Release -DWITH_SCANNER=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build build -j $(nproc)
- name: Validate Version