With `julia-actions/setup-julia` you can now specify `lts` and `pre` named versions

With the release of julia-actions/setup-julia v2.2.0 for GitHub actions it is now possible to use new named version specifiers:

  • 'lts' for the Long Term Support (LTS) julia version (currently v1.6.7)
  • 'pre' for the latest pre-release (currently v1.11.0-rc1)

So a typical test.yml might look like:

name: CI

on: [push, pull_request]

# needed for julia-actions/cache to delete old caches
permissions:
  actions: write
  contents: read

jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        julia-version:
          - 'lts' # long-term support release
          - '1'   # latest stable 1.x release
          - 'pre' # latest stable prerelease
          # - 'nightly'
        os:
          - ubuntu-latest
        include:
          - os: windows-latest
            julia-version: '1'
          - os: macOS-latest
            julia-version: '1'
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v4
    - uses: julia-actions/setup-julia@v2
      with:
        version: ${{ matrix.julia-version }}
    - uses: julia-actions/cache@v2
    - uses: julia-actions/julia-buildpkg@v1
    - uses: julia-actions/julia-runtest@v1

N.B. some choose to include nightly, but because GitHub actions doesn’t currently support allowed failures it can be a little noisy/distracting. The new 'pre' option serves as a less eager way to stay on top of testing with upcoming versions.

18 Likes

What happens when there are no pre releases?

2 Likes

What counts as a pre release? Alpha? Beta? RC?

The latest release of PkgTemplates.jl replaces "nightly" with "pre" in the default CI configuration

2 Likes

It returns the highest release including prereleases, so if there’s no prerelease beyond the current stable then you’ll get the current stable. That’s usually a relatively brief period

Correct

1 Like

- '1' # latest stable 1.x release

I would like this to be the latest stable release, but it doesn’t look like it (I get 1.11.0-rc3)? What am I missing/doing wrong?

1 Like

That looks like a recent bug in the workflow, you may want to open an issue about that.

Nevermind, it was a mistake in my ci config.

1 Like