#---------------------------------#
#      general configuration      #
#---------------------------------#

# version format
version: 2.1.{build}

# branches to build
branches:
  # whitelist
  only:
    - master
    - develop

  # blacklist
  except:
    - gh-pages

# Do not build on tags (GitHub, Bitbucket, GitLab, Gitea)
skip_tags: true

# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true

# Maximum number of concurrent jobs for the project
max_jobs: 1

#---------------------------------#
#    environment configuration    #
#---------------------------------#

# Build worker image (VM template)
image: Visual Studio 2022
# image: macos-bigsur

# scripts that are called at very beginning, before repo cloning
init:
  - git config --global core.autocrlf input

# clone directory
# clone_folder: c:\projects\RIDE

# fetch repository as zip archive
shallow_clone: false                 # default is "false"

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

# this is how to allow failing jobs in the matrix
# matrix:
#  fast_finish: false     # set this flag to immediately finish build once one of the jobs fails.
#  allow_failures:
#    - platform: x64
#      configuration: Release

# environment:
  # matrix:
  # - TOXENV: py36
  # - TOXENV: py37
  # - TOXENV: py38

# environment:
#  matrix:
#    - APPVEYOR_BUILD_WORKER_IMAGE: macOS
#      TOXENV: py38

build: off

# scripts that run after cloning repository
install:
  - C:\Python311-x64\python -m pip install -r requirements-dev.txt
  - C:\Python311-x64\python -m pip install -r requirements.txt
  - C:\Python311-x64\python -m pip install robotframework
  - C:\Python311-x64\python -m pip install .

#---------------------------------#
#       tests configuration       #
#---------------------------------#

# to run your custom scripts instead of automatic tests
test_script:
  - set PATH=C:\Python311-x64;C:\Python311-x64\Scripts;%PATH%
  - C:\Python311-x64\python -m invoke test-ci
  - 7z -r a coverage_report.7z %APPVEYOR_BUILD_FOLDER%\.coverage.* %APPVEYOR_BUILD_FOLDER%\.coverage-reports

artifacts:
  - path: coverage_report.7z
    name: coverage_report

