GNU Octave for continuous integration

Some of the most common corner cases cross-platform developers for Matlab / GNU Octave run into are over filesep and .exe suffixes. Rather than wait for 1 / N frustrated users to report such a bug, one can use GNU Octave with popular Windows continuous integration services such as Travis-CI or AppVeyor. For non-Windows laptops, consider GNU Octave on ReactOS in a ReactOS virtual machine for local Windows tests.

In general, we strongly recommend using Octave ≥ 4 as the Matlab compatibility is much better in newer GNU Octave releases.

GNU Octave CI

Here are CI templates using GNU Octave tests of .m code. Note that Octave runtests is quite distinct from Matlab runtests, so we use our own test scripts.

  • AppVeyor .appveyor.yml including:

  image:
  - Visual Studio 2017
  - ubuntu1804

  build: off

  init:
  - cmd: choco install octave.portable
  - sh: sudo apt-get install -yq --no-install-suggests --no-install-recommends octave > /dev/null
  
  test_script:
  - octave-cli test_myfuncs.m
  
  • Travis-CI .travis.yml including:

  language: c
  group: travis_latest
  dist: xenial
  
  addons:
    apt:
      packages:
      - octave

  matrix:
    include:
    - os: linux
    - os: windows
      language: sh
      before_install:
      - choco install octave.portable
    - os: osx
      before_install:
      - brew install octave > /dev/null
      
  script:
  - octave-cli test_myfuncs.m
  

For advanced users, consider setting up a Docker image to avoid the repeated GNU Octave installs.