Configuration for travis and appveyor

When working with Julia, it is common to use continuous integration tools like Travis and Appveyor to automate the testing and deployment process. These tools allow you to run your tests on different platforms and ensure that your code works as expected in different environments.

Option 1: Using a YAML file

One way to configure Travis and Appveyor is by using a YAML file. This file contains the necessary configuration settings for your project. Here’s an example of how you can set up Travis and Appveyor using a YAML file:


# .travis.yml
language: julia
os:
  - linux
  - osx
julia:
  - 1.0
  - nightly
notifications:
  email: false

In this example, we specify the language as Julia and the operating systems as Linux and macOS. We also specify the Julia versions we want to test our code against. Finally, we disable email notifications for the build.

Similarly, you can create a YAML file for Appveyor:


# appveyor.yml
environment:
  matrix:
    - JULIA_VERSION: "1.0"
    - JULIA_VERSION: "nightly"
install:
  - set PATH=%PATH%;C:Juliabin
build_script:
  - julia -e "using Pkg; Pkg.build()"
test_script:
  - julia -e "using Pkg; Pkg.test()"

In this example, we define the Julia versions we want to test against in the environment matrix. We also specify the installation and build/test scripts.

Option 2: Using Travis and Appveyor web interfaces

If you prefer a graphical interface, you can configure Travis and Appveyor directly from their web interfaces. Here’s how:

  1. For Travis, go to https://travis-ci.com/ and sign in with your GitHub account. Once signed in, you can enable Travis for your repository and configure the necessary settings.
  2. For Appveyor, go to https://www.appveyor.com/ and sign in with your GitHub account. Once signed in, you can add your repository and configure the necessary settings.

Using the web interfaces, you can specify the language, operating systems, Julia versions, and other settings for your project.

Option 3: Using a Julia package

If you prefer a more programmatic approach, you can use a Julia package like TravisCI.jl or Appveyor.jl to configure Travis and Appveyor. Here’s an example of how you can use the TravisCI.jl package:


# In your Julia code
using TravisCI

travis_setup()
travis_language("julia")
travis_os(["linux", "osx"])
travis_julia(["1.0", "nightly"])
travis_notifications(false)

In this example, we use the TravisCI.jl package to set up Travis. We specify the language, operating systems, Julia versions, and disable email notifications.

Similarly, you can use the Appveyor.jl package to configure Appveyor.

After considering these three options, the best one depends on your preference and the complexity of your project. If you prefer a simple and straightforward configuration, using a YAML file is a good choice. If you prefer a graphical interface, using the web interfaces is a convenient option. If you prefer a more programmatic approach or need more flexibility, using a Julia package is recommended.

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents