# Testing Julia packages on x86\_64 Alpine Linux with Drone CI

**URL:** <https://discourse.julialang.org/t/testing-julia-packages-on-x86-64-alpine-linux-with-drone-ci/57313>\
**Category:** Tooling\
**Tags:** ci\
**Created:** [March 16, 2021, 3:10pm UTC](https://discourse.julialang.org/t/testing-julia-packages-on-x86-64-alpine-linux-with-drone-ci/57313 "2021-03-16T15:10:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [March 16, 2021, 3:10pm UTC](https://discourse.julialang.org/t/testing-julia-packages-on-x86-64-alpine-linux-with-drone-ci/57313/1 "2021-03-16T15:10:58Z")

</div>

[Alpine Linux](https://alpinelinux.org/) is a _lightweight_ Linux distributions, the base installation can be as little as 5-6 MiB. It’s different from most common distributions in that it’s based on the [musl C library](https://www.musl-libc.org/).

There have already been a few official binaries of Julia for the musl C library (and so for Alpine Linux), but v1.6-rc2 is the first release where [JLL packages](https://docs.binarybuilder.org/stable/jll/), widely common in the ecosystem, will work properly with musl.

It’s now a good time to start testing some packages, especially those calling into binary libraries, on Alpine Linux. There is also a [Docker image of Julia for Alpine](https://hub.docker.com/_/julia), which we can use on [Drone CI](https://www.drone.io/) for testing. A `.drone.yml` script to run CI for a Julia package on x86\_64 (aka `amd64`) Alpine Linux can be

```yaml
---
kind: pipeline
name: linux - amd64 - Julia 1.6 (Alpine)

platform:
  os: linux
  arch: amd64

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

trigger:
  branch:
  - main

...

```

This is the Jsonnet file I used to generate it:

```nohighlight
local Pipeline(os, arch, version, alpine=false) = {
    kind: "pipeline",
    name: os+" - "+arch+" - Julia "+version+(if alpine then " (Alpine)" else ""),
    platform: {
        os: os,
        arch: arch
    },
    steps: [
        {
            name: "Run tests",
            image: "julia:"+version+(if alpine then "-alpine" else ""),
            commands: [
                "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true)'",
                "julia --project=. --check-bounds=yes --color=yes -e 'using Pkg; Pkg.build()'",
                "julia --project=. --check-bounds=yes --color=yes -e 'using Pkg; Pkg.test(coverage=true)'"
            ]
        }
    ],
    trigger: {
        branch: ["main"]
    }
};

[
    # Pipeline("linux", "arm", "1.3.1"),
    # Pipeline("linux", "arm", "1.4.1"),
    # Pipeline("linux", "arm64", "1.3"),
    # Pipeline("linux", "arm64", "1.6"),
    Pipeline("linux", "amd64", "1.6", true),
]

```

Note that the same script allows you to generate the build configurations for armv7l (aka `arm`) and armv8l (aka `arm64`) platforms with Ubuntu, as explained in [Testing on ARM with Drone CI](https://discourse.julialang.org/t/testing-on-arm-with-drone-ci/25871), just uncomment the desired lines.

For the record, in principle you can also use the Julia Alpine Docker image in GitHub Actions to run CI of your package, but the workflow [`julia-actions/julia-runtest`](https://github.com/julia-actions/julia-runtest) won’t work (unless you install `bash`), so you’d need a different workflow for that. Thus, I preferred to test on Alpine with Drone.
