From 624e95b874661d93cdd572ef83c7cfdf58351b88 Mon Sep 17 00:00:00 2001 From: James Bonfield Date: Mon, 24 Jun 2024 11:50:11 +0100 Subject: [PATCH] Add Windows CI via github actions Also amend .gitattributes file for more Windows text-mode removal as for some reason the GitHub Actions git is much more likely to use CR-LF line endings. Added libdeflate to the windows build. Corrected test/header_syms.pl to work on windows line endings. --- .gitattributes | 11 ++++++++ .github/workflows/windows-build.yml | 40 +++++++++++++++++++++++++++++ test/header_syms.pl | 1 + 3 files changed, 52 insertions(+) create mode 100644 .github/workflows/windows-build.yml diff --git a/.gitattributes b/.gitattributes index 5d9850bc7..2d5a80e04 100644 --- a/.gitattributes +++ b/.gitattributes @@ -24,3 +24,14 @@ test/index_dos.sam -text # Remove the text attribute from various faidx test files test/faidx/faidx*.fa* -text test/faidx/fastqs*.fq* -text +test/fastq/*.fa -text +test/fastq/*.fq -text +*.tst -text +*.out -text +*.crai -text +*.bai -text +*.csi -text +*.gzi -text +*.bcf -text +*.sam -text +*.sam.gz -text diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml new file mode 100644 index 000000000..c9c18461b --- /dev/null +++ b/.github/workflows/windows-build.yml @@ -0,0 +1,40 @@ +name: Windows/MinGW-W64 CI +on: [push, pull_request] + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Set up MSYS2 MinGW-W64 + uses: msys2/setup-msys2@v2 + with: + msystem: mingw64 + update: false + install: >- + git + zlib-devel + libbz2-devel + liblzma-devel + mingw-w64-x86_64-toolchain + mingw-w64-x86_64-autotools + mingw-w64-x86_64-tools-git + mingw-w64-x86_64-libdeflate + - name: Compile htslib + shell: msys2 {0} + run: | + export PATH=/mingw64/bin:$PATH + export MSYSTEM=MINGW64 + autoreconf -i + ./configure + make -j6 + - name: Check Htslib + shell: msys2 {0} + run: | + export PATH=/mingw64/bin:$PATH + export MSYSTEM=MINGW64 + make test-shlib-exports && make check + diff --git a/test/header_syms.pl b/test/header_syms.pl index fe5128a78..a8d4a885c 100755 --- a/test/header_syms.pl +++ b/test/header_syms.pl @@ -60,6 +60,7 @@ sub extract_symbols { open(my $f, '<', $file) || die "Couldn't open $file : $!\n"; my $text = <$f>; + $text =~ tr/\r//d; close($f) || die "Error reading $file : $!\n"; # Get rid of comments