Skip to content

Commit

Permalink
ci: add self hosted arm runner (brainboxdotcc#983)
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis authored Nov 1, 2023
1 parent 4f6d532 commit 49aaff0
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Install apt packages
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt install ${{ matrix.cfg.cpp-version }} libsodium-dev libopus-dev zlib1g-dev rpm
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt-get install -y ${{ matrix.cfg.cpp-version }} libsodium-dev libopus-dev zlib1g-dev rpm

- name: Generate CMake
run: mkdir build && cd build && cmake -DDPP_NO_VCPKG=ON -DAVX_TYPE=AVX0 -DCMAKE_BUILD_TYPE=Release ..
Expand Down Expand Up @@ -77,18 +77,20 @@ jobs:
strategy:
fail-fast: false # Don't fail everything if one fails. We want to test each OS/Compiler individually
matrix:
# GitHub hosted runners on Azure
# arm7hf is a self-hosted docker-based runner at Brainbox.cc. Raspberry Pi 4, 8gb 4-core with NEON
cfg:
- { arch: 'amd64', os: ubuntu-20.04, package: clang-10, cpp-version: clang++-10, cmake-flags: '' }
- { arch: 'amd64', os: ubuntu-22.04, package: clang-11, cpp-version: clang++-11, cmake-flags: '' }
- { arch: 'amd64', os: ubuntu-22.04, package: clang-12, cpp-version: clang++-12, cmake-flags: '' }
- { arch: 'amd64', os: ubuntu-22.04, package: clang-13, cpp-version: clang++-13, cmake-flags: '' }
- { arch: 'amd64', os: ubuntu-22.04, package: clang-14, cpp-version: clang++-14, cmake-flags: '' }
- { arch: 'amd64', os: ubuntu-22.04, package: clang-15, cpp-version: clang++-15, cmake-flags: '-DDPP_CORO=ON' }
- { arch: 'amd64', os: ubuntu-22.04, package: g++-12, cpp-version: g++-12, cmake-flags: '-DDPP_CORO=ON' }
- { arch: 'amd64', os: ubuntu-22.04, package: g++-11, cpp-version: g++-11, cmake-flags: '-DDPP_CORO=ON' }
- { arch: 'amd64', os: ubuntu-22.04, package: g++-10, cpp-version: g++-10, cmake-flags: '' }
- { arch: 'amd64', os: ubuntu-20.04, package: g++-9, cpp-version: g++-9, cmake-flags: '' }

- { arch: 'amd64', concurrency: 2, os: ubuntu-20.04, package: clang-10, cpp-version: clang++-10, cmake-flags: '', cpack: 'no' }
- { arch: 'amd64', concurrency: 2, os: ubuntu-22.04, package: clang-11, cpp-version: clang++-11, cmake-flags: '', cpack: 'no' }
- { arch: 'amd64', concurrency: 2, os: ubuntu-22.04, package: clang-12, cpp-version: clang++-12, cmake-flags: '', cpack: 'no' }
- { arch: 'amd64', concurrency: 2, os: ubuntu-22.04, package: clang-13, cpp-version: clang++-13, cmake-flags: '', cpack: 'no' }
- { arch: 'amd64', concurrency: 2, os: ubuntu-22.04, package: clang-14, cpp-version: clang++-14, cmake-flags: '', cpack: 'no' }
- { arch: 'amd64', concurrency: 2, os: ubuntu-22.04, package: clang-15, cpp-version: clang++-15, cmake-flags: '-DDPP_CORO=ON', cpack: 'no' }
- { arch: 'amd64', concurrency: 2, os: ubuntu-22.04, package: g++-12, cpp-version: g++-12, cmake-flags: '-DDPP_CORO=ON', cpack: 'no' }
- { arch: 'amd64', concurrency: 2, os: ubuntu-22.04, package: g++-11, cpp-version: g++-11, cmake-flags: '-DDPP_CORO=ON', cpack: 'no' }
- { arch: 'amd64', concurrency: 2, os: ubuntu-22.04, package: g++-10, cpp-version: g++-10, cmake-flags: '', cpack: 'yes' }
- { arch: 'amd64', concurrency: 2, os: ubuntu-20.04, package: g++-9, cpp-version: g++-9, cmake-flags: '', cpack: 'no' }
- { arch: 'arm7hf', concurrency: 4, os: [self-hosted, linux, ARM], package: g++-12, cpp-version: g++-12, cmake-flags: '', cpack: 'yes' }
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
Expand All @@ -99,29 +101,29 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Install apt packages
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt install ${{ matrix.cfg.package }} libsodium-dev libopus-dev zlib1g-dev rpm
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt-get install -y ${{ matrix.cfg.package }} pkg-config libsodium-dev libopus-dev zlib1g-dev rpm

- name: Generate CMake
run: mkdir build && cd build && cmake -DDPP_NO_VCPKG=ON -DAVX_TYPE=AVX0 -DCMAKE_BUILD_TYPE=Release ${{matrix.cfg.cmake-flags}} ..
env:
CXX: ${{matrix.cfg.cpp-version}}

- name: Build Project
run: cd build && make -j2
run: cd build && make -j${{ matrix.cfg.concurrency }}

- name: Package distributable
if: ${{ matrix.cfg.cpp-version == 'g++-10' }}
if: ${{ matrix.cfg.cpack == 'yes' }}
run: cd build && cpack --verbose

- name: Upload Binary (DEB)
if: ${{ matrix.cfg.cpp-version == 'g++-10' }}
if: ${{ matrix.cfg.cpack == 'yes' }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: "libdpp - Debian Package ${{matrix.cfg.arch}}"
path: '${{github.workspace}}/build/*.deb'

- name: Upload Binary (RPM)
if: ${{ matrix.cfg.cpp-version == 'g++-10' }}
if: ${{ matrix.cfg.cpack == 'yes' }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: "libdpp - RPM Package ${{matrix.cfg.arch}}"
Expand Down Expand Up @@ -229,7 +231,8 @@ jobs:
matrix:
cfg:
- {name: "ARM64", os: ubuntu-20.04, cmake-options: -DCMAKE_TOOLCHAIN_FILE=cmake/ARM64ToolChain.cmake}
- {name: "ARMv7 HF", os: ubuntu-20.04, cmake-options: -DCMAKE_TOOLCHAIN_FILE=cmake/ARMv7ToolChain.cmake}
# Replaced with self-hosted runner
# - {name: "ARMv7 HF", os: ubuntu-20.04, cmake-options: -DCMAKE_TOOLCHAIN_FILE=cmake/ARMv7ToolChain.cmake}
- {name: "Linux x86", os: ubuntu-20.04, cmake-options: -DCMAKE_TOOLCHAIN_FILE=cmake/LINUXx86ToolChain.cmake -DBUILD_VOICE_SUPPORT=OFF}
- {name: "ARMv6", os: ubuntu-20.04, cmake-options: -DCMAKE_TOOLCHAIN_FILE=cmake/ARMv6ToolChain.cmake}

Expand All @@ -245,7 +248,7 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Install Packages
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt install cmake rpm
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt-get install -y cmake rpm

- name: Generate CMakeFiles
run: mkdir build && cd build && sudo cmake ${{matrix.cfg.cmake-options}} -DDPP_NO_VCPKG=ON -DCMAKE_BUILD_TYPE=Release -DAVX_TYPE=AVX0 ..
Expand Down

0 comments on commit 49aaff0

Please sign in to comment.