diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 9720dc2dd..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,52 +0,0 @@ -# version format. -# you can use {branch} name in version format too -# version: 1.0.{build}-{branch} -version: 'vers.{build}' - -# branches to build -branches: - except: - - gh-pages - -# Do not build on tags (GitHub and BitBucket) -skip_tags: true - -# Skipping commits affecting specific files (GitHub only). More details here: /docs/appveyor-yml -#skip_commits: -# files: -# - docs/* -# - '**/*.html' - -# Appveyor Windows images are based on Visual studio version -image: Visual Studio 2019 - -# We use Mingw/Msys, so use pacman for installs -install: - - set HOME=. - - set MSYSTEM=MINGW64 - - set PATH=C:/msys64/usr/bin;C:/msys64/mingw64/bin;%PATH% - - set MINGWPREFIX=x86_64-w64-mingw32 - - "sh -lc \"pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-autotools mingw-w64-x86_64-zlib mingw-w64-x86_64-bzip2 mingw-w64-x86_64-xz mingw-w64-x86_64-curl\"" - -# The user may have e.g. jkbonfield/bcftools branch FOO and an associated -# jkbonfield/htslib branch FOO. If so use that related htslib, obtained by -# munging $APPVEYOR_REPO_NAME. Otherwise we assume this is a PR only to -# bcftools and should be linked against samtools(org)/htslib develop branch. -clone_script: - - "sh -lc \"if test x$APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME != x ; then git clone --branch=$APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH https://github.com/$APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME $APPVEYOR_BUILD_FOLDER ; else false ; fi || git clone --branch=$APPVEYOR_REPO_BRANCH https://github.com/$APPVEYOR_REPO_NAME $APPVEYOR_BUILD_FOLDER\"" - - "sh -lc \"git show-branch --sha1-name HEAD" - - "sh -lc \"git clone --recurse-submodules --shallow-submodules --branch=$APPVEYOR_REPO_BRANCH https://github.com/`echo $APPVEYOR_REPO_NAME|sed 's#/bcftools#/htslib#'`.git $APPVEYOR_BUILD_FOLDER/htslib || git clone --recurse-submodules --shallow-submodules https://github.com/samtools/htslib.git $APPVEYOR_BUILD_FOLDER/htslib \"" - - "sh -lc \"cd $APPVEYOR_BUILD_FOLDER/htslib && git show-branch --sha1-name HEAD\"" - -build_script: - - set HOME=. - - set MSYSTEM=MINGW64 - - set PATH=C:/msys64/usr/bin;C:/msys64/mingw64/bin;%PATH% - - "sh -lc \"(cd htslib; autoreconf -i)\"" - - "sh -lc \"autoreconf -i && ./configure --enable-werror && make -j2\"" - -test_script: - - set HOME=. - - set MSYSTEM=MINGW64 - - set PATH=C:/msys64/usr/bin;C:/msys64/mingw64/bin;%APPVEYOR_BUILD_FOLDER%/htslib;%PATH% - - "sh -lc \"MSYS2_ARG_CONV_EXCL=* make test-plugins\"" diff --git a/.ci_helpers/clone b/.ci_helpers/clone index c0b7c4d95..34054b863 100755 --- a/.ci_helpers/clone +++ b/.ci_helpers/clone @@ -18,7 +18,7 @@ ref='' [ -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" ] diff --git a/.gitattributes b/.gitattributes index 9d42c7c43..8c3a1419d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,3 +10,6 @@ .git* export-ignore .ci_helpers export-ignore README.md export-ignore + +# Prevent Windows cr-lf endings. +test/** -text diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml new file mode 100644 index 000000000..49a14f37f --- /dev/null +++ b/.github/workflows/windows-build.yml @@ -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 +