Skip to content

Commit

Permalink
chore: Move cmake-freebsd-stage2 back into the toxcore repo.
Browse files Browse the repository at this point in the history
This is more likely to change with the code so should live here, not in
dockerfiles.
  • Loading branch information
iphydf committed Dec 21, 2021
1 parent 656c769 commit 2bfd13c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build on FreeBSD
run:
cd .. && mv c-toxcore / && mkdir c-toxcore &&
cd /work && ./cmake-freebsd-stage2
run: .travis/cmake-freebsd-stage2
54 changes: 54 additions & 0 deletions .travis/cmake-freebsd-stage2
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
# Copyright (C) 2018-2021 nurupo

# Toxcore building

set -eux

cd ..
mv c-toxcore /
mkdir c-toxcore

pushd /work
. cmake-freebsd-env.sh
popd

# === Get VM ready to build the code ===

start_vm

# Copy over toxcore code from Travis to qemu
scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P "$SSH_PORT" -r /c-toxcore root@localhost:~

RUN ls -lh

cd /c-toxcore
CACHEDIR=/opt/cache
mkdir "$CACHEDIR"
. ".travis/flags-clang.sh"

add_ld_flag -Wl,-z,defs

# Make compilation error on a warning
add_flag -Werror

RUN 'cmake -B_build -Hc-toxcore \
-DCMAKE_C_FLAGS="$C_FLAGS" \
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
-DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \
-DCMAKE_INSTALL_PREFIX:PATH="_install" \
-DMIN_LOGGER_LEVEL=TRACE \
-DMUST_BUILD_TOXAV=ON \
-DNON_HERMETIC_TESTS=ON \
-DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=300 \
-DUSE_IPV6=OFF \
-DAUTOTEST=ON'

# We created the VM with the same number of cores as the host, so the host-ran `nproc` here is fine
RUN 'gmake "-j$NPROC" -k install -C_build'
RUN 'gmake "-j$NPROC" test ARGS="-j50" -C_build || \
gmake -j50 -C_build test ARGS="-j50 --rerun-failed" || \
gmake -j1 -C_build test ARGS="-j1 --rerun-failed" CTEST_OUTPUT_ON_FAILURE=1 || \
true'

0 comments on commit 2bfd13c

Please sign in to comment.