julia-actions / setup-julia

This action sets up a Julia environment for use in actions by downloading a specified version of Julia and adding it to PATH.
MIT License
93 stars 23 forks source link

Windows subsystem for linux #44

Closed ericphanson closed 4 years ago

ericphanson commented 4 years ago

Is it possible to use setup-julia for testing Julia packages running on Windows subsystem for linux (WSL) and/or WSL2? I see WSL is in the Github Actions environment (https://github.com/actions/virtual-environments/issues/50), but I'm not sure what's needed on the setup-julia side. Since Julia is now in virtual-environments too, wsl julia should just work to launch Julia on WSL, but then we can't specify the Julia versions to test on.

SaschaMann commented 4 years ago

I don't know of a way to directly interact with the wsl environment through the GitHub SDK. My guess would be that it could be installed by running the usual Julia install bash script within WSL.

Effectively you'd have to run these steps within WSL:

  1. Infer the version from the version input, e.g. using https://github.com/npm/node-semver as CLI tool
  2. Plug in the right version into wget https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.1-linux-x86_64.tar.gz
  3. tar xf <juliaDownloadPath> --strip-components=1 -C ~/julia
  4. Add ~/julia/bin to PATH

A separate (composite) action might be simpler because most of the existing code of setup-julia would have to be refactored as it relies on the OS of the runner to match the OS that Julia will be installed in and makes heavy use of the actions SDK which can't be used here.

ericphanson commented 4 years ago

Cool, thanks for the information!

Vampire commented 4 years ago

Also to use WSL you first have to install a distribution. You can do so using my shiny new setup-wsl action: https://github.com/marketplace/actions/setup-wsl :-)

SaschaMann commented 4 years ago

A separate (composite) action might be simpler because most of the existing code of setup-julia would have to be refactored as it relies on the OS of the runner to match the OS that Julia will be installed in and makes heavy use of the actions SDK which can't be used here.

I thought about it more, I think this is out-of-scope for setup-julia for the reasons above, unless someone else wants to add and maintain it.