Skip to content

Commit

Permalink
test: Add FreeBSD VM action on GitHub.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Feb 19, 2024
1 parent 52ece0f commit 92578af
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 10 deletions.
32 changes: 25 additions & 7 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ bazel-dbg_task:
- cd /src/workspace && bazel test -k
--build_tag_filters=-haskell
--test_tag_filters=-haskell
--remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST
--
//c-toxcore/...
-//c-toxcore/auto_tests:tcp_relay_test # TODO(robinlinden): Why does this pass locally but not in Cirrus?
Expand All @@ -47,13 +48,30 @@ cimple_task:
//c-toxcore/...

freebsd_task:
container:
image: toxchat/freebsd:latest
cpu: 2
memory: 4G
kvm: true
freebsd_instance:
image_family: freebsd-14-0
configure_script:
- PAGER=cat ASSUME_ALWAYS_YES=YES pkg install
cmake
git
gmake
googletest
libconfig
libsodium
libvpx
opus
pkgconf
- git submodule update --init --recursive
- cd .. && mv cirrus-ci-build /work/c-toxcore && mkdir cirrus-ci-build
test_all_script:
- cd /work/c-toxcore && .github/scripts/cmake-freebsd
- |
# TODO(iphydf): Investigate FreeBSD failures on these tests.
sed -Ei -e '/\(dht_getnodes_api\)/s/^/#/' auto_tests/CMakeLists.txt
cmake . \
-DMIN_LOGGER_LEVEL=TRACE \
-DMUST_BUILD_TOXAV=ON \
-DNON_HERMETIC_TESTS=ON \
-DTEST_TIMEOUT_SECONDS=50 \
-DUSE_IPV6=OFF \
-DAUTOTEST=ON
cmake --build . --target install
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6
41 changes: 39 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tool: [autotools, clang-tidy, compcert, cppcheck, doxygen, goblint, infer, misra, modules, rpm, slimcc, sparse, tcc, tokstyle]
tool: [autotools, clang-tidy, compcert, cppcheck, doxygen, goblint, infer, freebsd, misra, modules, rpm, slimcc, sparse, tcc, tokstyle]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:

run: |
# TODO(iphydf): Investigate NetBSD failures on these tests.
sed -Ei -e '/(TCP|dht_getnodes_api)/s/^/#/' auto_tests/CMakeLists.txt
sed -Ei -e '/\((TCP|dht_getnodes_api)\)/s/^/#/' auto_tests/CMakeLists.txt
cmake . \
-DMIN_LOGGER_LEVEL=TRACE \
-DMUST_BUILD_TOXAV=ON \
Expand All @@ -157,6 +157,43 @@ jobs:
cmake --build . --target install
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6
build-freebsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Test in FreeBSD
id: test
uses: vmactions/freebsd-vm@v1
with:
usesh: true
copyback: false
prepare:
PAGER=cat ASSUME_ALWAYS_YES=YES pkg install
cmake
git
gmake
googletest
libconfig
libsodium
libvpx
opus
pkgconf

run: |
# TODO(iphydf): Investigate FreeBSD failures on these tests.
sed -Ei -e '/\(dht_getnodes_api\)/s/^/#/' auto_tests/CMakeLists.txt
cmake . \
-DMIN_LOGGER_LEVEL=TRACE \
-DMUST_BUILD_TOXAV=ON \
-DNON_HERMETIC_TESTS=ON \
-DTEST_TIMEOUT_SECONDS=50 \
-DUSE_IPV6=OFF \
-DAUTOTEST=ON
cmake --build . --target install
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6
mypy:
runs-on: ubuntu-latest
steps:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion other/docker/freebsd/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -eux
BUILD=freebsd
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" .
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

0 comments on commit 92578af

Please sign in to comment.