# set clone depth
clone_depth: 5                  # clone entire repository history if not defined

environment:
  PACKAGES: "-P libgmp-devel"
  CFLAGS: "--coverage -g"
  LDFLAGS: "--coverage"

  # To test building GAP both using the bundled libraries (zlib and GMP), as
  # well as using the versions distributed with cygwin, we do the former in
  # the 32 bit build and the latter in the 64 bit build. B
  matrix:
    - CYG_ARCH: x86
      CYG_ROOT: C:\cygwin
      ABI: 32
    - CYG_ARCH: x86_64
      CYG_ROOT: C:\cygwin64

install:
  - '%CYG_ROOT%\setup-%CYG_ARCH%.exe -qnNdO -R %CYG_ROOT% -s http://cygwin.mirror.constant.com -l %CYG_ROOT%/var/cache/setup %PACKAGES%'

# scripts that run after cloning repository
build_script:
  - SET "PATH=%CYG_ROOT%\bin;%PATH%"
  - bash -lc "cd $APPVEYOR_BUILD_FOLDER && ./autogen.sh && ./configure"
  - bash -lc "cd $APPVEYOR_BUILD_FOLDER && make -j2 V=1"

test_script:
  - bash -lc "cd $APPVEYOR_BUILD_FOLDER && cd tst && ./run_all.sh"

on_success:
  - bash -lc "cd $APPVEYOR_BUILD_FOLDER && gcov functions/*/*.c"
  - curl --retry 5 -s https://codecov.io/bash > codecov.sh
  - bash -lc "cd $APPVEYOR_BUILD_FOLDER && ./codecov.sh"
