From ea89d38b6b181e982e9bcd7d66e6cf7c0fa6794c Mon Sep 17 00:00:00 2001 From: James Bonfield Date: Wed, 22 Jul 2026 16:31:19 +0100 Subject: [PATCH 1/5] Add concurrency checks to the older linux/mac/windows CI tests These cancel the builds if a newer version of the PR is pushed. Signed-off-by: James Bonfield --- .github/workflows/linux-build.yml | 4 ++++ .github/workflows/macos-build.yml | 4 ++++ .github/workflows/windows-build.yml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index a8cae56f..c4c2bedc 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -1,6 +1,10 @@ name: Linux CI on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build-linux: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 2bef0388..19c655b8 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -1,6 +1,10 @@ name: Mac OS CI on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build-macos: runs-on: macos-latest diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index a413d620..b7254107 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -1,6 +1,10 @@ name: Windows/MinGW-W64 CI on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build-windows: runs-on: windows-latest From 3b8809b24a64f0834ec79369610e7db9100464f5 Mon Sep 17 00:00:00 2001 From: James Bonfield Date: Wed, 22 Jul 2026 16:26:30 +0100 Subject: [PATCH 2/5] Add more CI tests for linux containers and BSD/Solaris VMs Also modifies sed statement syntax to be more traditional (fix on Solaris) Signed-off-by: James Bonfield --- .github/workflows/container-build.yml | 79 ++++++++++++ .github/workflows/vm-build.yml | 165 ++++++++++++++++++++++++++ test/trio-dnm3/test.sh | 2 +- 3 files changed, 245 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/container-build.yml create mode 100644 .github/workflows/vm-build.yml diff --git a/.github/workflows/container-build.yml b/.github/workflows/container-build.yml new file mode 100644 index 00000000..160a9589 --- /dev/null +++ b/.github/workflows/container-build.yml @@ -0,0 +1,79 @@ +name: Containers +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + Containers: + # comment out if we're using the cache + runs-on: ubuntu-latest + container: ${{ matrix.image }} + strategy: + fail-fast: false + matrix: + os: ['alpine', 'archlinux', 'centos', 'rockylinux', 'opensuse'] + include: + - os: alpine + image: alpine:3.23 + cflags: -Wno-sign-conversion + - os: archlinux + image: archlinux:base-devel + #-Wno-discarded-qualified needed? + cflags: -Wno-sign-conversion -Wno-discarded-qualifiers + - os: centos + image: quay.io/centos/centos:10 + - os: rockylinux + image: quay.io/rockylinux/rockylinux:10 + - os: opensuse + image: opensuse/tumbleweed + #needed? + cflags: -Wno-discarded-qualifiers + + steps: + - name: Install dependencies + run: | + case ${{ matrix.os }} in + *alpine*) + apk update + apk add git autoconf automake make gcc musl-dev perl bash zlib-dev bzip2-dev xz-dev curl-dev openssl-dev ncurses-dev + ;; + *archlinux*) + pacman -Syyu --noconfirm + pacman -Sy --noconfirm base-devel git libdeflate + ;; + *centos*) + yum install -y autoconf automake make gcc perl-Data-Dumper zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel git perl-FindBin ncurses-devel + ;; + *rockylinux*) + yum install -y autoconf automake make gcc perl-Data-Dumper zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel git perl-FindBin diffutils ncurses-devel + ;; + *opensuse*) + zypper --non-interactive install --allow-downgrade --force-resolution git autoconf automake make gcc perl zlib-devel libbz2-devel xz-devel libcurl-devel libopenssl-devel diffutils llvm-clang ncurses-devel bzip2 + ;; + esac + + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + persist-credentials: false + + - name: Clone htslib + run: | + git config --global --add safe.directory `pwd` + htslib_pr=`git log -2 --format='%s' | sed -n 's/.*htslib#\([0-9]*\).*/\1/p'` + .ci_helpers/clone ${GITHUB_REPOSITORY_OWNER} htslib htslib ${GITHUB_HEAD_REF:-$GITHUB_REF_NAME} $htslib_pr + + - name: Configure bcftools + run: | + autoreconf -i + ./configure --enable-werror CFLAGS="-g -O3 -std=gnu99 ${{ matrix.cflags }}" + + - name: Build htslib and bcftools + run: | + make -j5 + + - name: Test + run: | + make check diff --git a/.github/workflows/vm-build.yml b/.github/workflows/vm-build.yml new file mode 100644 index 00000000..026d376c --- /dev/null +++ b/.github/workflows/vm-build.yml @@ -0,0 +1,165 @@ +name: VMs +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + # ---------- + FreeBSD: + runs-on: ubuntu-latest + strategy: + fail-fast: false + #matrix: + # arch: ['x86_64', 'aarch64'] + + steps: + - name: Checkout + # This is actions/checkout@v6.0.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + submodules: true + fetch-depth: 1 + + - name: Clone htslib + run: | + git config --global --add safe.directory `pwd` + htslib_pr=`git log -2 --format='%s' | sed -n 's/.*htslib#\([0-9]*\).*/\1/p'` + .ci_helpers/clone ${GITHUB_REPOSITORY_OWNER} htslib htslib ${GITHUB_HEAD_REF:-$GITHUB_REF_NAME} $htslib_pr + + - name: Setup VM + # This is vmactions/freebsd-vm@@v1.5.2 + uses: vmactions/freebsd-vm@77ed28d336d03fe19a3f4f7266c1d2c4714dd79d + with: + #debug-on-error: true + #vnc-password: ${{ secrets.VNC_PASSWORD }} + #arch: ${{ matrix.arch }} + usesh: true + cpu: 4 + prepare: | + pkg update + pkg install -y autoconf automake bash curl bzip2 gmake libdeflate perl5 git + + # Inside VM + - name: Configure + shell: freebsd {0} + run: | + (cd htslib; autoreconf -i) + autoreconf -i + ./configure --enable-werror CFLAGS="-g -O3 -fsanitize=address,undefined -DHTS_ALLOW_UNALIGNED=0 -Wno-format-truncation -Wno-format-overflow" CPPFLAGS="-I/usr/local/include" LDFLAGS="-fsanitize=address,undefined -L/usr/local/lib -Wl,-R/usr/local/lib" + + - name: Build + shell: freebsd {0} + run: | + gmake -j5 + + - name: Test + shell: freebsd {0} + run: | + gmake check + + # ---------- + OpenBSD: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Checkout + # This is actions/checkout@v6.0.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + submodules: true + fetch-depth: 1 + + - name: Clone htslib + run: | + git config --global --add safe.directory `pwd` + mkdir -p htslib + htslib_pr=`git log -2 --format='%s' | sed -n 's/.*htslib#\([0-9]*\).*/\1/p'` + .ci_helpers/clone ${GITHUB_REPOSITORY_OWNER} htslib htslib ${GITHUB_HEAD_REF:-$GITHUB_REF_NAME} $htslib_pr + + - name: Setup VM + # This is vmactions/openbsd-vm@v1.4.5 + uses: vmactions/openbsd-vm@c941015845c0f0c429676840963dc63b226d4f69 + with: + usesh: true + cpu: 4 + prepare: | + pkg_add autoconf-2.71p0 automake-1.18.1 bash bzip2 curl gmake libdeflate xz git + + # Inside VM + - name: Configure + shell: openbsd {0} + run: | + export AUTOCONF_VERSION=2.71 + export AUTOMAKE_VERSION=1.18 + (cd htslib; autoreconf -i) + autoreconf -i + ./configure --enable-werror CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib" + + - name: Build + shell: openbsd {0} + run: | + gmake -j5 + + - name: Test + shell: openbsd {0} + run: | + gmake check + + + # ---------- + Solaris: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Checkout + # This is actions/checkout@v6.0.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + submodules: true + fetch-depth: 1 + + - name: Clone htslib + run: | + git config --global --add safe.directory `pwd` + mkdir -p htslib + htslib_pr=`git log -2 --format='%s' | sed -n 's/.*htslib#\([0-9]*\).*/\1/p'` + .ci_helpers/clone ${GITHUB_REPOSITORY_OWNER} htslib htslib ${GITHUB_HEAD_REF:-$GITHUB_REF_NAME} $htslib_pr + + - name: Setup VM + # This is vmactions/solaris-vm@v1.3.8 + uses: vmactions/solaris-vm@315163f088b66e55bbcc45928bd224d4973b2312 + with: + release: "11.4-clang-19" + usesh: true + cpu: 4 + prepare: | + pkg install autoconf automake bash curl bzip2 git + + # Inside VM + - name: Configure + shell: solaris {0} + run: | + (cd htslib; autoreconf -i) + autoreconf -i + # -Wno-char-subscripts turns off errors such as phase.c:460, which are + # false alarms anyway. + ./configure --enable-werror CFLAGS="-g -O3 -Wno-char-subscripts" + + - name: Build + shell: solaris {0} + run: | + gmake -j5 + + - name: Test + shell: solaris {0} + run: | + # We need more compliant versions of tr and grep. + PATH=/usr/xpg4/bin:$PATH + export PATH + gmake check diff --git a/test/trio-dnm3/test.sh b/test/trio-dnm3/test.sh index 7caf0937..9217a159 100755 --- a/test/trio-dnm3/test.sh +++ b/test/trio-dnm3/test.sh @@ -7,5 +7,5 @@ export LC_ALL=C for x in *.vcf; do "$BCFTOOLS" +trio-dnm3 -p 1X:child,dad,mom $x | "$BCFTOOLS" query -uf$x'\t%CHROM:%POS\t%EXP\t[ %DNM]\t[ %VAF]\t[ %AD]\t%REF,%ALT\t[ %VA]\t[ %SP]'; -done | sort | sed 's,fp,-, ; s,tp,o,' +done | sort | sed 's/fp/-/;s/tp/o/' From b8efd20c4bae1c001e5eb2cfb40bf3b9ee3abc3d Mon Sep 17 00:00:00 2001 From: James Bonfield Date: Wed, 22 Jul 2026 17:11:20 +0100 Subject: [PATCH 3/5] Fix plot-vcfstats to work on uncompressed data. This fixes a bug introduced in 270751f which assumes gunzip supports the -f option. This is not honoured by busybox gunzip, which is the default on Alpine linux. Signed-off-by: James Bonfield --- misc/plot-vcfstats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/plot-vcfstats b/misc/plot-vcfstats index 13a9c60e..1913132c 100755 --- a/misc/plot-vcfstats +++ b/misc/plot-vcfstats @@ -644,7 +644,7 @@ sub parse_vcfstats1 my ($opts,$i) = @_; my $file = $$opts{vcfstats}[$i]; print STDERR "Parsing bcftools stats output: $file\n" unless !$$opts{verbose}; - open(my $fh,"gunzip -cfq $file |") or error("gunzip -cfq $file: $!"); + open(my $fh,"gunzip -cq $file || cat $file |") or error("gunzip -cfq $file: $!"); my $line = <$fh>; if ( !$line or !($line=~/^# This file was produced by \S*/) ) { error("Sanity check failed: was this file generated by bcftools stats?"); } my %dat; From 5a1c849fa03b86c0d697e728b82c9b907d157d08 Mon Sep 17 00:00:00 2001 From: James Bonfield Date: Wed, 22 Jul 2026 17:14:58 +0100 Subject: [PATCH 4/5] Fix version.sh to work on a git clone without git executable. This odd combination happens when we clone on one system and build on another, but sharing or copying the directory. Signed-off-by: James Bonfield --- version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sh b/version.sh index 72b2e5bc..15d4d9c1 100755 --- a/version.sh +++ b/version.sh @@ -27,7 +27,7 @@ VERSION=1.24 # If we have a git clone, then check against the current tag -if [ -e .git ] +if [ -e .git -a "x`which git`" != "x" ] then # If we ever get to 10.x this will need to be more liberal VERSION=`git describe --match '[0-9].[0-9]*' --dirty --always` From f8c08909fa69d702d4931bfd14ac3f25e6d6ea23 Mon Sep 17 00:00:00 2001 From: James Bonfield Date: Wed, 22 Jul 2026 17:38:06 +0100 Subject: [PATCH 5/5] Ignore git safe.directory warnings in VERSION query Signed-off-by: James Bonfield --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8ce191c2..34fd97b4 100644 --- a/Makefile +++ b/Makefile @@ -117,8 +117,8 @@ PACKAGE_VERSION = 1.24 # $(shell), :=, etc are GNU Make-specific. If you don't have GNU Make, # comment out this conditional. ifneq "$(wildcard .git)" "" -PACKAGE_VERSION := $(shell git describe --always --dirty) -DOC_VERSION := $(shell git describe --always)+ +PACKAGE_VERSION := $(shell git -c safe.directory=`pwd` describe --always --dirty) +DOC_VERSION := $(shell git -c safe.directory=`pwd` describe --always)+ DOC_DATE := $(shell date +'%Y-%m-%d %R %Z') # Force version.h to be remade if $(PACKAGE_VERSION) has changed.