# Using Julia in GitHub Actions

**URL:** <https://discourse.julialang.org/t/using-julia-in-github-actions/27805>\
**Category:** Tooling\
**Tags:** announcement, ci\
**Created:** [August 21, 2019, 3:17pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805 "2019-08-21T15:17:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaschaMann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschamann/32/2852_2.png) [@SaschaMann](https://discourse.julialang.org/u/SaschaMann)\
**Post date:** [August 21, 2019, 3:17pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/1 "2019-08-21T15:17:45Z")

</div>

Hey everyone,

I’ve created a GitHub [Action](https://github.com/marketplace/actions/setup-julia-environment) that sets up a Julia environment as a base for CI and other automation tasks.

The action lets you setup 32- and 64-bit Julia environments on all supported OSes (Windows Server 2016 & 2019, Ubuntu 16.04 & 18.04 and macOS X Mojave 10.14).

It still lacks some features like version shortcuts or support for nightly builds but it’s enough to try out GH Actions so I’ve decided to share it already. Check the readme for more info on what’s still missing.

> **Example workflow: Manually running package tests**
>
> ```yaml
> name: Run tests
> 
> on: [push, pull_request]
> 
> jobs:
> test:
> runs-on: ${{ matrix.os }}
> strategy:
> matrix:
> julia-version: [1.0.4, 1.2.0, 1.3.0-rc1]
> julia-arch: [x64, x86]
> os: [ubuntu-latest, windows-latest, macOS-latest]
> # 32-bit Julia binaries are not available on macOS
> exclude:
> - os: macOS-latest
> julia-arch: x86
>     
> steps:
> - uses: actions/checkout@v1.0.0
> - name: "Set up Julia"
> uses: julia-actions/setup-julia@v0.2
> with:
> version: ${{ matrix.julia-version }}
> arch: ${{ matrix.julia-arch }}
> - name: "Run tests"
> run: |
> julia --project=@. -e "using Pkg; Pkg.instantiate();"
> julia --project=@. -e "using Pkg; Pkg.test(\"Example\");"
> 
> ```

You can find “real world” examples in the [Exercism.jl package](https://github.com/exercism/Exercism.jl/pull/14) and in the [Exercism Julia track](https://github.com/exercism/julia/pull/153), a non-package project.

More infos about setting up workflows in general can be found in the [GitHub docs](https://help.github.com/en/categories/automating-your-workflow-with-github-actions).

* * *

Actions allow you to hook into any repo event, not just pushes and PRs which could be used for some interesting automation that doesn’t require running and trusting apps.  
Even if you’re not interested in that, I think they are worth a look because in my (limited) testing, they run a lot faster than Travis CI and also allow more parallel builds.

If you run into any issues, please open an [issue](https://github.com/julia-actions/setup-julia/issues) and if you create any Julia-related actions, please share them, I’m interested to see what people use them for!

---

<div class="post-metadata">

**Author:** ![SaschaMann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschamann/32/2852_2.png) [@SaschaMann](https://discourse.julialang.org/u/SaschaMann)\
**Post date:** [September 23, 2019, 7:47pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/2 "2019-09-23T19:47:03Z")

</div>

If you’ve tried them out or are interested in actions, I’d like to hear some input on the following issue that came up about what package CI workflows should look like: [https://github.com/julia-actions/julia-runtest/issues/1](https://github.com/julia-actions/julia-runtest/issues/1)

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [September 23, 2019, 9:32pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/3 "2019-09-23T21:32:35Z")

</div>

I have completely moved [StringBuilders.jl](https://github.com/davidanthoff/StringBuilders.jl) over to use these new GitHub Actions for its CI testing. So far so good. It seems really fast, plus we get Windows, Mac and Linux all in one service (and all running in parallel).

The current configuration looks like [this](https://github.com/davidanthoff/StringBuilders.jl/blob/master/.github/workflows/ci-workflow.yml).

Just be warned: we are still tinkering with the exact design of these actions, so at this point this is probably not super stable in terms of the API of these actions.

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [December 16, 2019, 11:51am UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/4 "2019-12-16T11:51:55Z")

</div>

> The current configuration looks like [this](https://github.com/davidanthoff/StringBuilders.jl/blob/master/.github/workflows/ci-workflow.yml).

got 404 😭

---

<div class="post-metadata">

**Author:** ![SaschaMann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschamann/32/2852_2.png) [@SaschaMann](https://discourse.julialang.org/u/SaschaMann)\
**Post date:** [December 16, 2019, 3:04pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/5 "2019-12-16T15:04:47Z")

</div>

PkgTemplates.jl has up-to-date example workflows: [Testing & Coverage](https://github.com/invenia/PkgTemplates.jl/blob/master/test/fixtures/AllPlugins/.github/workflows/ci.yml), [Testing & Docs deployment](https://github.com/invenia/PkgTemplates.jl/blob/master/test/fixtures/DocumenterGitHubActions/.github/workflows/ci.yml)

---

<div class="post-metadata">

**Author:** ![dkarrasch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dkarrasch/32/7410_2.png) [@dkarrasch](https://discourse.julialang.org/u/dkarrasch)\
**Post date:** [March 25, 2020, 6:31pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/6 "2020-03-25T18:31:07Z")

</div>

Unfortunately, there seems to be an issue with the julia-actions/julia-uploadcodecov, see, for instance,  
[GitHub - JuliaGeometry/CoordinateTransformations.jl: A fresh approach to coordinate transformations...](https://github.com/JuliaGeometry/CoordinateTransformations.jl). Coverage reports don’t get uploaded. Is there any solution to this? Should I file an issue somewhere?

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [March 25, 2020, 6:59pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/7 "2020-03-25T18:59:32Z")

</div>

I’ve actually moved away from the `julia-uploadcodecov` action and am using the native codecov action instead. Main benefit is that it should work without a token in many cases. You can take a look at what I’m using right now [here](https://github.com/davidanthoff/StringBuilders.jl/blob/master/.github/workflows/jlpkgbutler-ci-master-workflow.yml#L32).

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [September 8, 2020, 11:07am UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/8 "2020-09-08T11:07:28Z")

</div>

This thread makes it look easy to switch from travis … to github actions. I’m thinking about doing this and am still confused. I almost understand things well enough (I got Greetings Octocat to work) to do the experiment, but don’t want to break what I already have.

Do the normal things (CI + codecov + documenter) “just work” if one makes the obvious changes and follows the templates from @davidanthoff and @SaschaMann? Any gotchas  
I should know about? Any downside in switching from travis?

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [September 8, 2020, 11:16am UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/9 "2020-09-08T11:16:44Z")

</div>

Novice question: You have docdeploy as a separate .yml file. Is that the optimal way to do this? Are you using Documenter.jl? I don’t see the references to version numbers that I would in a .travis.yml file.

Is all this encoded in julia-actions/julia-docdeploy@releases/v1? The example from

[https://juliadocs.github.io/Documenter.jl/stable/man/hosting/](https://juliadocs.github.io/Documenter.jl/stable/man/hosting/)

has more of the things from .travis.yml. Are they not really needed?

My travis stuff is

```julia
include:
    - stage: "Documentation"
      julia: 1.5
      os: osx
      script:
        - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd()));
                                               Pkg.instantiate()'
        - julia --project=docs/ docs/make.jl

```

---

<div class="post-metadata">

**Author:** ![SaschaMann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschamann/32/2852_2.png) [@SaschaMann](https://discourse.julialang.org/u/SaschaMann)\
**Post date:** [September 9, 2020, 3:30pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/10 "2020-09-09T15:30:13Z")

</div>

> [@ctkelley](#):
>
> Do the normal things (CI + codecov + documenter) “just work” if one makes the obvious changes and follows the templates from @davidanthoff and @SaschaMann?

For most packages, they should “just work”. The examples in this thread may be a bit outdated, I personally would use [PkgTemplates](https://github.com/invenia/PkgTemplates.jl/blob/master/test/fixtures/AllPlugins/.github/workflows/ci.yml) for the CI files, and Documenter docs for deploying docs, and adapt those if necessary.

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [September 9, 2020, 3:42pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/11 "2020-09-09T15:42:50Z")

</div>

I got the template from Documenter.jl to work with minimal tweaking. I’m amazed at how much faster my docs are processed now. Very happy so far. Having doc.yml as a stand-alone file makes this stuff easier to keep track of as well.

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [September 10, 2020, 9:15am UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/12 "2020-09-10T09:15:27Z")

</div>

When I do simple updates like correcting typos in README.md, I can put [skip-ci] in the comments to keep travis from doing anything.

Is there a way to do this with github actions?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 10, 2020, 9:56am UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/13 "2020-09-10T09:56:05Z")

</div>

A practical question: this eats up minutes of runtime from the free allowance (practically 3000 for Pro), right? Is there some provision for public repos like Travis?

How does this work out in practice for people, do you ever use up the free tier?

---

<div class="post-metadata">

**Author:** ![SaschaMann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschamann/32/2852_2.png) [@SaschaMann](https://discourse.julialang.org/u/SaschaMann)\
**Post date:** [September 10, 2020, 11:41am UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/14 "2020-09-10T11:41:29Z")

</div>

It doesn’t. The minutes are only for private repos and not affected by public repos. Public repos are free and not limited

---

<div class="post-metadata">

**Author:** ![SaschaMann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschamann/32/2852_2.png) [@SaschaMann](https://discourse.julialang.org/u/SaschaMann)\
**Post date:** [September 10, 2020, 11:42am UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/15 "2020-09-10T11:42:57Z")

</div>

Not natively, but there are some workarounds: [https://github.community/t/github-actions-does-not-respect-skip-ci/17325/14](https://github.community/t/github-actions-does-not-respect-skip-ci/17325/14)

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [September 10, 2020, 11:52am UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/16 "2020-09-10T11:52:56Z")

</div>

I’ve been using

```julia
on:
  push:
    branches:
      - master
    paths-ignore:
      - 'LICENSE.md'
      - 'README.md'
      - '.github/workflows/CompatHelper.yml'
      - '.github/workflows/TagBot.yml'
  pull_request:
    branches:
      - master
    paths-ignore:
      - 'LICENSE.md'
      - 'README.md'
      - '.github/workflows/CompatHelper.yml'
      - '.github/workflows/TagBot.yml'

```

which means only run CI on PRs or pushes to master (which avoids the issue of pushing to a branch and having CI run on that and on the PR), and ignore any changes which only affect the license, readme, or CompatHelper or TagBot. Not as flexible as `[ci skip]` since you have to hardcode the list, but on the other hand at least you don’t have to write `[ci skip]` either.

---

<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:** [September 10, 2020, 12:01pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/17 "2020-09-10T12:01:26Z")

</div>

I didn’t know you could ignore some files, that’s a useful feature that I wish all CI services had!

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [September 10, 2020, 12:45pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/18 "2020-09-10T12:45:57Z")

</div>

I just tried this with a commit of a change to README.md and it did not work. What I did was mostly I cut/paste job from your post. Did I miss a space or a tab? My docs.yml file is

```julia
name: Documentation

on:
  push:
    branches:
      - 'master'
      - 'release-'
    tags: '*'
    paths-ignore:
      - 'LICENSE.md'
      - 'README.md'
      - '.github/workflows/TagBot.yml'
  pull_request:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        julia-version: [1.5]
        julia-arch: [x86]
        os: [ubuntu-latest]
    steps:
      - uses: actions/checkout@v2
      - uses: julia-actions/setup-julia@latest
        with:
          version: ${{ matrix.julia-version }}
      - name: Install dependencies
        run: julia --project=docs/ -e 'using Pkg;
              Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
      - name: Build and deploy
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
        run: julia --project=docs --color=yes docs/make.jl

```

---

<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:** [September 10, 2020, 12:57pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/19 "2020-09-10T12:57:26Z")

</div>

However, after reading the [documentation](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths) I’m less convinced it’s implemented in a good way. In my opinion it should be “when _all_ modified files match the patters”, instead of “at least of file matches the patterns”

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [September 10, 2020, 1:08pm UTC](https://discourse.julialang.org/t/using-julia-in-github-actions/27805/20 "2020-09-10T13:08:51Z")

</div>

Are you sure that’s the right interpretation? They have this example

> A workflow with the following path filter will only run on `push` events that include at least one file outside the `docs` directory at the root of the repository.
> 
> ```julia
> on:
> push:
> paths-ignore:
> - 'docs/**'
> 
> ```

that I thought meant it was doing the right thing (i.e. only skip CI if all the paths are ignored).

[Next page](https://discourse.julialang.org/t/using-julia-in-github-actions/27805.md?page=2)
