Add FreeBSD and NetBSD CI (#3600)
Add a BSD workflow with FreeBSD and NetBSD jobs that run the same build and tests as the linux job, each inside a VM booted under QEMU on an ubuntu-latest runner. The tests/shtest $NO_COLOR pty checks are now skipped on NetBSD, as they already are on SunOS.
This commit is contained in:
2 files changed
+92
No files matched your search
@@ -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
|
||||
@@ -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; }
|
||||
|
||||
Reference in new issue
Block a user