Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI improvements #2289

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .appveyor.yml

This file was deleted.

20 changes: 16 additions & 4 deletions .ci_helpers/clone
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,25 @@
# omitted or if there is no branch with that name, checks out origin/HEAD
# from the samtools/htslib repository.

repository=$1
localdir=$2
branch=$3
echo CLONE: ${@+"$@"}

owner=$1
repository="https://github.com/$owner/$2"
localdir=$3
branch=$4
htslib_PR=$5

ref=''
[ -n "$branch" ] && ref=$(git ls-remote --heads "$repository" "$branch" 2>/dev/null)
[ -z "$ref" ] && repository='https://github.com/samtools/htslib.git'

set -x
git clone --recurse-submodules --shallow-submodules --depth=1 ${ref:+--branch="$branch"} "$repository" "$localdir"
git clone --recurse-submodules --shallow-submodules --depth=2 ${ref:+--branch="$branch"} "$repository" "$localdir"

# NB: "samtools" as the owner/organisation, not the repo name
if [ "x$owner" = "xsamtools" -a -z "$ref" -a "x$htslib_PR" != "x" ]
then
cd "$localdir"
git fetch origin "pull/$htslib_PR/head"
git checkout FETCH_HEAD
fi
12 changes: 10 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ timeout_in: 10m
# clone with our own commands too.
clone_template: &HTSLIB_CLONE
htslib_clone_script: |
.ci_helpers/clone "https://github.com/${CIRRUS_REPO_OWNER}/htslib" "${HTSDIR}" "${CIRRUS_BRANCH}"

# Tricky, but when run as a PR Cirrus-CI obscures the branch name and
# replaces it by pull/<num>. This means we can't automatically get PRs
# to test whether the user has a similarly named branch to compiler and
# test against.
#
# Instead if we add htslib#NUM into the first line of the commit then
# we will use that PR from htslib instead. This is only needed when
# making a PR, so for development prior to the PR being made the
# CIRRUS_BRANCH will be used in preference.
.ci_helpers/clone ${CIRRUS_REPO_OWNER} htslib "${HTSDIR}" "${CIRRUS_BRANCH}" `printenv CIRRUS_CHANGE_TITLE | sed -n 's/.*htslib#\([0-9]*\).*/\1/p'`

#--------------------------------------------------
# Template: bcftools compile and test
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
.git* export-ignore
.ci_helpers export-ignore
README.md export-ignore

# Prevent Windows cr-lf endings.
test/** -text
52 changes: 52 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Windows/MinGW-W64 CI
on: [push, pull_request]

jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up MSYS2 MinGW-W64
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: false
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-autotools
mingw-w64-x86_64-curl
mingw-w64-x86_64-libdeflate
mingw-w64-x86_64-tools-git
mingw-w64-x86_64-zlib
mingw-w64-x86_64-bzip2
mingw-w64-x86_64-xz
- name: Clone htslib
shell: msys2 {0}
run: |
export PATH="$PATH:/mingw64/bin:/c/Program Files/Git/bin"
export MSYSTEM=MINGW64
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
pushd .
cd htslib
autoreconf -i
popd
- name: Compile bcftools
shell: msys2 {0}
run: |
export PATH="$PATH:/mingw64/bin:/c/Program Files/Git/bin"
export MSYSTEM=MINGW64
autoheader
autoconf -Wno-syntax
./configure --enable-werror
make -j4
- name: Check bcftools
shell: msys2 {0}
run: |
export PATH="$PATH:/mingw64/bin:/c/Program Files/Git/bin"
export MSYSTEM=MINGW64
make check