Testing on ARM with Drone CI

Drone CI is a free and open-source continuous integration platform and allows running tests for Julia packages on ARM architecture. You can install a local instance of Drone or use Drone Cloud at https://cloud.drone.io/ Documentation of Drone is at https://docs.drone.io/.

The .drone.yml script to add to the top-directory of your repository to run tests looks like the following:

---
kind: pipeline
name: linux - arm - Julia 1.0

platform:
  os: linux
  arch: arm

steps:
- name: build
  image: julia:1.0
  commands:
  - "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"

---
kind: pipeline
name: linux - arm - Julia 1.1

platform:
  os: linux
  arch: arm

steps:
- name: build
  image: julia:1.1
  commands:
  - "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"

---
kind: pipeline
name: linux - arm64 - Julia 1.0

platform:
  os: linux
  arch: arm64

steps:
- name: build
  image: julia:1.0
  commands:
  - "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"

---
kind: pipeline
name: linux - arm64 - Julia 1.1

platform:
  os: linux
  arch: arm64

steps:
- name: build
  image: julia:1.1
  commands:
  - "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"

...

The YAML script doesn’t support a matrix, like Travis does, to easily setup different jobs for different architectures and/or Julia versions, however it’s possible to write a simple Jsonnet script from which the full YAML can be automatically generated. For example, I generated the above YAML script from this Jsonnet script:

local Pipeline(os, arch, version) = {
    kind: "pipeline",
    name: os+" - "+arch+" - Julia "+version,
    platform: {
	os: os,
	arch: arch
    },
    steps: [
	{
	    name: "build",
	    image: "julia:"+version,
	    commands: [
		"julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"
	    ]
	}
    ]
};

[
    Pipeline("linux", "arm",   "1.0"),
    Pipeline("linux", "arm",   "1.1"),
    Pipeline("linux", "arm64", "1.0"),
    Pipeline("linux", "arm64", "1.1")
]

While it’s possible to directly use the Jsonnet script in a local instance of Drone (see, e.g., https://discourse.drone.io/t/porting-matrix-builds-to-1-0-multi-machine-pipelines/2966), this feature is not supported by Drone Cloud (see https://discourse.drone.io/t/drone-cloud-and-jsonnet/4621), so if you want to use this service you have to manually generate the YAML file and have it in your repository. See here how to download and install the Drone command line utility. Once you get it, you can generate the .drone.yml script with

drone jsonnet --stream .drone.jsonnet
3 Likes