AppVeyor for Windows and Linux builds

1 minute read

Related: f2py on AppVeyor Windows


AppVeyor Linux-based CI is equally fast (> 5x faster than Travis CI) as the free Windows-based CI AppVeyor is well known for. For MacOS Travis CI is a prime choice.

Minimal Examples

Minimal working examples of .appveyor.yml for both Windows and Linux (Ubuntu 16.04) using Python, C++ and/or Fortran are given below. We often opt to use per-line distinct commands for each OS where needed. The other way is to use matrix:, but unique per-line OS commands are more intuitive for many use cases.

  • For Linux, the stack: stanza picks software/version for a set of common programs–here, Python 3.
  • Note the use of cmd: for Windows-exclusive commands, and sh: for Linux-exclusive commands.

Python

Note: f2py on AppVeyor Windows has its own page–importing Fortran libraries from Python.

This appveyor.yml runs Python 3.7 on Windows 10 and Ubuntu 16.04:

image:
- Visual Studio 2017
- Ubuntu

stack: python 3

environment:
  PY_DIR: C:\Python37-x64

clone_depth: 3

build: off

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

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

Fortran

image:
- Visual Studio 2017
- Ubuntu

environment:
  MINGW_DIR: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin

clone_depth: 3

build: off

init:
- cmd: set PATH=%MINGW_DIR%;%PATH%

install:
- cd bin
- cmd: cmake -G "MinGW Makefiles" -DCMAKE_SH="CMAKE_SH-NOTFOUND" ..
- sh: cmake ..

- cmake --build . --target install

test_script:
- ctest -V

Manual Linux install

Install additional Linux programs in AppVeyor via commands like:

init:
- sh: sudo apt -yq update > /dev/null
- sh: sudo apt install -yq --no-install-suggests --no-install-recommends bwbasic > /dev/null

Notes


Command “python setup.py egg_info” failed with error code 1

Try using Miniconda3 C:\Miniconda3-x64

Leave a comment