Files
2026-06-04 15:28:21 +02:00

410 lines
12 KiB
YAML

name: Linux
on:
push:
branches: [ RC_1_2 RC_2_0 master ]
pull_request:
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 2
filter: tree:0
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: install clang-format-18
run: sudo apt-get update && sudo apt-get install -y clang-format-18
- uses: j178/prek-action@v2
- name: clang-format check (changed lines vs PR base)
if: github.event_name == 'pull_request'
run: git-clang-format-18 --binary clang-format-18 --diff HEAD^1
build:
name: build
runs-on: ubuntu-22.04
continue-on-error: true
strategy:
matrix:
std: [17, 20]
config:
- asio-debugging=on picker-debugging=on
- extensions=off logging=off streaming=off super-seeding=off share-mode=off predictive-pieces=off dht=off alert-msg=off encryption=off mutable-torrents=off deprecated-functions=off
- crypto=gcrypt
- mmap-disk-io=off
steps:
- name: checkout
uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 1
filter: tree:0
- name: update package lists
continue-on-error: true
run: |
sudo apt update
- uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
override_cache_key: ccache-linux-build-${{ github.base_ref }}-${{ matrix.config }}
ccache_options: |
max_size=5G
- name: install boost
run: |
sudo apt install libboost-python-dev libboost-tools-dev libboost-dev libboost-system-dev python3
echo "using gcc ;" >>~/user-config.jam
- name: install gcrypt
if: ${{ contains(matrix.config, 'crypto=gcrypt') }}
run: sudo apt install libgcrypt20-dev
- name: build library
run: |
b2 ${{ matrix.config }} cxxstd=${{ matrix.std }} warnings-as-errors=on
- name: build examples
run: |
cd examples
b2 ${{ matrix.config }} cxxstd=${{ matrix.std }} warnings-as-errors=on
- name: build tools
run: |
cd tools
b2 ${{ matrix.config }} cxxstd=${{ matrix.std }} warnings-as-errors=on
- name: build python bindings
run: |
cd bindings/python
echo "using python ;" >>~/user-config.jam
BOOST_ROOT="" b2 ${{ matrix.config }} cxxstd=${{ matrix.std }} warnings-as-errors=on
fuzzers:
name: Fuzzers
runs-on: ubuntu-24.04
continue-on-error: true
steps:
- name: checkout
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 1
filter: tree:0
- name: update package lists
continue-on-error: true
run: |
sudo apt update
- uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
override_cache_key: ccache-linux-fuzzers-${{ github.base_ref }}
ccache_options: |
max_size=500M
- name: install clang-15
continue-on-error: true
run: |
sudo apt install clang-15
- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-dev libboost-system-dev libboost-json-dev
echo "using clang : 15 : clang++-15 ;" >>~/user-config.jam
- name: build fuzzers
run: |
cd fuzzers
b2 clang deprecated-functions=on,off warnings-as-errors=on
check_headers:
name: check headers
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 1
filter: tree:0
- name: update package lists
continue-on-error: true
run: |
sudo apt update
- uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
override_cache_key: ccache-linux-check-headers-${{ github.base_ref }}
ccache_options: |
max_size=500M
- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
echo "using gcc ;" >>~/user-config.jam
- name: compile header files individually
run: |
b2 check-headers warnings-as-errors=on
test:
name: Tests
runs-on: ubuntu-24.04
continue-on-error: true
strategy:
matrix:
include:
- config: webtorrent=on address-sanitizer=norecover undefined-sanitizer=norecover crypto=openssl invariant-checks=on
- config: toolset=clang logging=off address-sanitizer=norecover undefined-sanitizer=norecover invariant-checks=on
- config: thread-sanitizer=norecover crypto=openssl release debug-symbols=on cxxflags=-Wno-tsan
- config: crypto=gnutls invariant-checks=full
- config: deprecated-functions=off invariant-checks=full
steps:
- name: checkout
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 1
filter: tree:0
- name: update package lists
continue-on-error: true
run: |
sudo apt update
- uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
override_cache_key: ccache-linux-tests-${{ matrix.config }}-${{ github.base_ref }}
ccache_options: |
max_size=5G
- name: install gnutls
if: ${{ contains(matrix.config, 'crypto=gnutls') }}
run: |
sudo apt install libgnutls28-dev
- name: install boost.json
if: ${{ contains(matrix.config, 'webtorrent=on') }}
run: |
sudo apt install libboost-json-dev
- name: install clang-16
continue-on-error: true
run: |
sudo apt install clang-16
- name: install GCC-14
continue-on-error: true
run: |
sudo apt install gcc-14
- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
pip install websockets
echo "using gcc : 14 : g++-14 ;" >>~/user-config.jam
echo "using clang : 16 : clang++-16 ;" >>~/user-config.jam
- name: build and run tests
env:
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.asan.suppressions
run: |
cd test
b2 ${{ matrix.config }} -l500 warnings-as-errors=on debug-iterators=on asserts=on deterministic-tests
b2 ${{ matrix.config }} -l500 testing.execute=off warnings-as-errors=on debug-iterators=on asserts=on test_lsd test_hasher test_hasher512 test_natpmp enum_if
b2 ${{ matrix.config }} -l500 warnings-as-errors=on debug-iterators=on asserts=on simulate-slow=hash test_slow_hash
- name: run tests (flaky)
env:
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.asan.suppressions
uses: nick-fields/retry@v4
with:
timeout_minutes: 30
retry_wait_seconds: 4
max_attempts: 3
command: (cd test; b2 ${{ matrix.config }} -l500 warnings-as-errors=on debug-iterators=on asserts=on)
test-32bit:
name: Tests (32-bit)
runs-on: ubuntu-24.04
continue-on-error: true
steps:
- name: checkout
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 1
filter: tree:0
- name: update package lists
continue-on-error: true
run: |
sudo apt update
- uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
override_cache_key: ccache-linux-tests-32bit-${{ github.base_ref }}
ccache_options: |
max_size=5G
- name: install 32-bit toolchain
run: |
sudo apt install -y g++-multilib
- name: install boost from source
run: |
wget -nv -O boost.tar.gz https://archives.boost.io/release/1.86.0/source/boost_1_86_0.tar.gz
tar xzf boost.tar.gz
mv boost_1_86_0 boost
cd boost
./bootstrap.sh
./b2 headers
- name: configure user-config.jam
run: echo "using gcc ;" >>~/user-config.jam
- name: build and run tests (32-bit)
env:
BOOST_ROOT: ${{ github.workspace }}/boost
BOOST_BUILD_PATH: ${{ github.workspace }}/boost/tools/build
run: |
cd test
${BOOST_ROOT}/b2 address-model=32 architecture=x86 -l500 \
crypto=built-in warnings-as-errors=on debug-iterators=on asserts=on \
deterministic-tests
sim:
name: Simulations
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 1
filter: tree:0
- name: update package lists
continue-on-error: true
run: |
sudo apt update
- uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
override_cache_key: ccache-linux-simulations-${{ github.base_ref }}
ccache_options: |
max_size=5G
- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
echo "using gcc ;" >>~/user-config.jam
- name: build and run simulations
run: |
cd simulation
b2 debug-iterators=on invariant-checks=full asserts=on picker-debugging=on
- name: build simulations no deprecated
run: |
cd simulation
b2 testing.execute=off deprecated-functions=off
dist:
name: build dist
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-22.04]
steps:
- name: checkout
uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 1
filter: tree:0
- name: update package lists
continue-on-error: true
run: |
sudo apt update
- uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
override_cache_key: ccache-linux-dist-${{ matrix.os }}-${{ github.base_ref }}
ccache_options: |
max_size=15G
- name: install dependencies
run: |
sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev
sudo apt install python3-docutils python3-pygments python3-pil gsfonts inkscape icoutils graphviz hunspell imagemagick python3-setuptools
python3 -m pip install aafigure
echo "using gcc ;" >>~/user-config.jam
- name: build tarball
run: AAFIGURE=~/.local/bin/aafigure RST2HTML=rst2html make dist
- uses: actions/upload-artifact@v6
with:
name: tarball-${{ matrix.os }}
path: libtorrent-rasterbar-*.tar.gz
- name: test-tarball (b2 install)
run: |
tar xvzf libtorrent-rasterbar-*.tar.gz
cd libtorrent-rasterbar-*/
b2 install --prefix=test-install-root
cat test-install-root/lib/pkgconfig/libtorrent-rasterbar.pc
- name: test-tarball (b2 tests)
run: |
cd libtorrent-rasterbar-*/test
b2 testing.execute=off
b2 test_torrent_info
- name: test-tarball (python bindings)
run: |
cd libtorrent-rasterbar-*/bindings/python/
python3 setup.py build