diff --git a/.github/workflows/bsd.yml b/.github/workflows/bsd.yml new file mode 100644 index 00000000..fe75fe1d --- /dev/null +++ b/.github/workflows/bsd.yml @@ -0,0 +1,86 @@ +name: BSD + +on: + push: + branches: + - master + tags: + - "jq-*" + pull_request: + +jobs: + freebsd: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Clone repository + uses: actions/checkout@v7 + with: + submodules: true + - name: Build and test + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + cache-after-prepare: true + prepare: | + pkg install -y autoconf automake libtool gmake git + run: | + set -e + # The VM runs as root over a checkout owned by another uid, so git + # rejects the repository and scripts/version -- which AC_INIT calls + # through m4_esyscmd_s -- exits 128, leaving JQ_VERSION undefined. + git config --global --add safe.directory "$PWD" + git config --global --add safe.directory "$PWD/vendor/oniguruma" + autoreconf -i + ./configure --disable-docs --with-oniguruma=builtin --enable-static + gmake -j"$(sysctl -n hw.ncpu)" + gmake check VERBOSE=yes + - name: Upload Test Logs + if: ${{ failure() }} + uses: actions/upload-artifact@v7 + with: + name: test-logs-freebsd + retention-days: 7 + path: | + test-suite.log + tests/*.log + + netbsd: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Clone repository + uses: actions/checkout@v7 + with: + submodules: true + - name: Build and test + uses: vmactions/netbsd-vm@v1 + with: + usesh: true + cache-after-prepare: true + prepare: | + # The image's default PKG_PATH falls back to a 9.0 package set; + # point it at the running release instead. + PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -m)/$(uname -r)/All/" + export PKG_PATH + pkg_add autoconf automake libtool gmake git + run: | + set -e + # The VM runs as root over a checkout owned by another uid, so git + # rejects the repository and scripts/version -- which AC_INIT calls + # through m4_esyscmd_s -- exits 128, leaving JQ_VERSION undefined. + git config --global --add safe.directory "$PWD" + git config --global --add safe.directory "$PWD/vendor/oniguruma" + autoreconf -i + ./configure --disable-docs --with-oniguruma=builtin --enable-static + gmake -j"$(sysctl -n hw.ncpu)" + gmake check VERBOSE=yes + - name: Upload Test Logs + if: ${{ failure() }} + uses: actions/upload-artifact@v7 + with: + name: test-logs-netbsd + retention-days: 7 + path: | + test-suite.log + tests/*.log diff --git a/tests/shtest b/tests/shtest index 511067fc..ba64016e 100755 --- a/tests/shtest +++ b/tests/shtest @@ -5,10 +5,12 @@ msys=false mingw=false sunos=false +netbsd=false case "$(uname -s)" in MSYS*) msys=true;; MINGW*) mingw=true;; SunOS*) sunos=true;; +NetBSD*) netbsd=true;; esac JQ_NO_B=$JQ @@ -677,6 +679,10 @@ test_no_color=true $msys && test_no_color=false $mingw && test_no_color=false $sunos && test_no_color=false +# NetBSD's script(1) intermittently loses the whole session output (the +# output file comes back empty for fast commands about half the time), so +# the pty checks cannot run reliably there. +$netbsd && test_no_color=false if $test_no_color && command -v script >/dev/null 2>&1; then if script -qc echo /dev/null >/dev/null 2>&1; then faketty() { script -qec "$*" /dev/null; }