AppVeyor for Windows and Linux builds

1 minute read

AppVeyor in 2018 bought free Linux builds as an integral companion with free Windows builds. AppVeyor Linux images come with limited pre-installed software. This means for now, part of your .appveyor.yml will be installing the prereqs.

Minimal Example

Minimal working examples of .appveyor.yml for both Windows and Linux (Ubuntu 16.04) using Python, C++ and/or Fortran are useful. I have opted to use per-line distinct commands for each OS where needed. The other way is to use Travis-CI-like matrix:, but I find this unique per-line OS commands more intuitive.

  1. choose which images will be used. The snippet below selects Windows Server 2016 (Windows 10-like) and Ubuntu 16.04.

    - Visual Studio 2017
    - Ubuntu
  2. For Linux, pick software/version for a limited subset of programs

    stack: python 3
  3. set environment variables. There are several quirks I worked around in my .appveyor.yml. For my test setup, I didn’t need to set any Linux environment variables.
  4. note the use of cmd: for Windows-exclusive commands, and sh: for Linux-exclusive commands.
  5. Install Linux prereqs via commands like (gcc+ and gcc are pre-installed):

    - sh: sudo apt -yq update > /dev/null
    - sh: sudo apt install -yq --no-install-suggests --no-install-recommends gfortran cmake make > /dev/null

Example appveyor.yml, running Python 3.7 on Windows 10 and Ubuntu 16.04:

- Visual Studio 2017
- Ubuntu

stack: python 3

  PY_DIR: C:\Python36-x64

clone_depth: 3

- cmd: set PATH=%PY_DIR%;%PY_DIR%\Scripts;%PATH%

- pip install -e .[tests]
- pytest -sv


Command “python egg_info” failed with error code 1

Try using Miniconda3 C:\Miniconda3-x64

Leave a Comment