Skip to content

Merge pull request #638 from trognes/fix/ci-workflows #124

Merge pull request #638 from trognes/fix/ci-workflows

Merge pull request #638 from trognes/fix/ci-workflows #124

name: Build and test
on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux-x86_64:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ghostscript groff libbz2-dev zlib1g-dev
- name: Configure and build
run: |
./autogen.sh
./configure CFLAGS="-O2" CXXFLAGS="-O2"
make clean
make ARFLAGS="cr" -j$(nproc)
bin/vsearch -v
- name: Run tests
run: |
export PATH=$PWD/bin:$PATH
git clone --branch ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }} https://github.com/frederic-mahe/vsearch-tests
cd vsearch-tests
bash ./run_all_tests.sh
cross-build:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
target:
- { name: windows-x86_64, host: x86_64-w64-mingw32, pkgs: "mingw-w64 libz-mingw-w64-dev" }
- { name: linux-aarch64, host: aarch64-linux-gnu, pkgs: "g++-aarch64-linux-gnu libsimde-dev" }
- { name: linux-mips64el, host: mips64el-linux-gnuabi64, pkgs: "g++-mips64el-linux-gnuabi64 libsimde-dev" }
- { name: linux-ppc64le, host: powerpc64le-linux-gnu, pkgs: "g++-powerpc64le-linux-gnu libsimde-dev" }
- { name: linux-riscv64, host: riscv64-linux-gnu, pkgs: "g++-riscv64-linux-gnu libsimde-dev" }
name: cross-build (${{ matrix.target.name }})
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ghostscript groff libbz2-dev zlib1g-dev ${{ matrix.target.pkgs }}
- name: Build for ${{ matrix.target.name }}
run: |
./autogen.sh
./configure CFLAGS="-O2" CXXFLAGS="-O2" --host=${{ matrix.target.host }}
make clean
make ARFLAGS="cr" -j$(nproc)
macos-arm64:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
run: |
# aws/tap and azure/bicep are pre-tapped on the GitHub macOS runner
# images and trigger Homebrew tap-trust warnings; we use nothing from
# them, so remove them before updating/installing. azure/bicep ships an
# installed formula (bicep): uninstall it first so the tap untaps
# cleanly without --force (which would itself print a warning). Each
# step is guarded so it stays quiet and non-fatal on a future image
# that no longer has these taps/formulae. We do NOT silence stderr of
# the actual operations: hiding it is what masked the earlier failure.
brew list bicep >/dev/null 2>&1 && brew uninstall bicep
for tap in aws/tap azure/bicep; do
brew tap | grep -qx "$tap" && brew untap "$tap"
done
brew update
brew install autoconf automake ghostscript groff
- name: Configure and build
run: |
./autogen.sh
./configure CFLAGS="-O2" CXXFLAGS="-O2"
make clean
make ARFLAGS="cr" -j$(sysctl -n hw.ncpu)
bin/vsearch -v
- name: Run tests
run: |
export PATH=$PWD/bin:$PATH
git clone --branch ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }} https://github.com/frederic-mahe/vsearch-tests
cd vsearch-tests
bash ./run_all_tests.sh
macos-x86_64:
runs-on: macos-15-intel
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
run: |
# aws/tap and azure/bicep are pre-tapped on the GitHub macOS runner
# images and trigger Homebrew tap-trust warnings; we use nothing from
# them, so remove them before updating/installing. azure/bicep ships an
# installed formula (bicep): uninstall it first so the tap untaps
# cleanly without --force (which would itself print a warning). Each
# step is guarded so it stays quiet and non-fatal on a future image
# that no longer has these taps/formulae. We do NOT silence stderr of
# the actual operations: hiding it is what masked the earlier failure.
brew list bicep >/dev/null 2>&1 && brew uninstall bicep
for tap in aws/tap azure/bicep; do
brew tap | grep -qx "$tap" && brew untap "$tap"
done
brew update
brew install autoconf automake ghostscript groff
- name: Configure and build
run: |
./autogen.sh
./configure CFLAGS="-O2" CXXFLAGS="-O2"
make clean
make ARFLAGS="cr" -j$(sysctl -n hw.ncpu)
bin/vsearch -v
- name: Run tests
run: |
export PATH=$PWD/bin:$PATH
git clone --branch ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }} https://github.com/frederic-mahe/vsearch-tests
cd vsearch-tests
bash ./run_all_tests.sh
freebsd-x86_64:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Build and test on FreeBSD
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg update -f
pkg install -y autoconf automake gmake bash git bzip2 ghostscript10 groff
pw useradd -n runner -m -s /usr/local/bin/bash
run: |
./autogen.sh
./configure CFLAGS="-O2" CXXFLAGS="-O2"
gmake clean
gmake ARFLAGS="cr" -j$(sysctl -n hw.ncpu)
bin/vsearch -v
git clone --branch ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }} https://github.com/frederic-mahe/vsearch-tests
chown -R runner vsearch-tests
# The suite runs ~7,700 tests, each printing a result line.
# Streaming that volume over the vmactions SSH channel wedges
# the FreeBSD guest after a few minutes (it stops responding at
# a random point). Run the suite into a log file inside the VM
# instead, then surface a bounded summary so CI still reports
# failures. root bypasses POSIX permission checks, so the "file
# not readable/writable" tests need an unprivileged user.
status=0
su -m runner -c "cd vsearch-tests && PATH=$PWD/bin:\$PATH bash ./run_all_tests.sh > test.log 2>&1" || status=$?
echo "===== FAIL lines ====="
grep -E 'FAIL' vsearch-tests/test.log || echo "(none)"
echo "===== last 50 lines of test.log ====="
tail -n 50 vsearch-tests/test.log
exit $status