From 92578afe4b4e4647a3f50b71cb6e7e8ff1e03ed3 Mon Sep 17 00:00:00 2001 From: iphydf Date: Mon, 19 Feb 2024 15:33:53 +0000 Subject: [PATCH] test: Add FreeBSD VM action on GitHub. --- .cirrus.yml | 32 +++++++++++---- .github/workflows/ci.yml | 41 ++++++++++++++++++- .../{Dockerfile => freebsd.Dockerfile} | 0 other/docker/freebsd/run | 2 +- 4 files changed, 65 insertions(+), 10 deletions(-) rename other/docker/freebsd/{Dockerfile => freebsd.Dockerfile} (100%) diff --git a/.cirrus.yml b/.cirrus.yml index 903d98a5..bb477b26 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -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? @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b3138d0..8f4b3436 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 \ @@ -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: diff --git a/other/docker/freebsd/Dockerfile b/other/docker/freebsd/freebsd.Dockerfile similarity index 100% rename from other/docker/freebsd/Dockerfile rename to other/docker/freebsd/freebsd.Dockerfile diff --git a/other/docker/freebsd/run b/other/docker/freebsd/run index f4448a46..d844ec4f 100755 --- a/other/docker/freebsd/run +++ b/other/docker/freebsd/run @@ -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" .