Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to allow a shell intput? I am running a self-hosted ci and would like to run with powershell #17

Closed
guilhermebodin opened this issue Nov 5, 2021 · 4 comments

Comments

@guilhermebodin
Copy link

guilhermebodin commented Nov 5, 2021

something like

name: 'Run Pkg.build'
description: 'Run the build step in a Julia package'
author: 'David Anthoff'

branding:
  icon: 'box'
  color: 'gray-dark'

inputs:
  project:
    description: 'Value passed to the --project flag. The default value is the repository root: "@."'
    default: '@.'
  shell:
    description: 'The shell that you wish to run on your ci'
    default: bash

runs:
  using: 'composite'
  steps:
    # Occasionally, there are rather large delays (> a few hours)
    # between the time a package is registered in General and
    # propagated to pkg.julialang.org.  We can avoid this by manually
    # cloning ~/.julia/registries/General/ in Julia 1.5 and later.
    # See:
    # * https://github.com/JuliaLang/Pkg.jl/issues/2011
    # * https://github.com/JuliaRegistries/General/issues/16777
    # * https://github.com/JuliaPackaging/PkgServer.jl/issues/60
  - run: julia --color=yes "$GITHUB_ACTION_PATH"/add_general_registry.jl
    shell: inputs.shell
    env:
      # We set `JULIA_PKG_SERVER` only for this step to enforce
      # `Pkg.Registry.add` to use Git.  This way, Pkg.jl can send
      # the request metadata to pkg.julialang.org when installing
      # packages via `Pkg.test`.
      JULIA_PKG_SERVER: ""

  - run: julia --color=yes --project=${{ inputs.project }} -e 'using Pkg; if VERSION >= v"1.1.0-rc1"; Pkg.build(verbose=true); else Pkg.build(); end'
    shell: inputs.shell
@SaschaMann
Copy link
Member

SaschaMann commented Nov 5, 2021

I have not tested it yet but I believe that would cause issues with the quotation marks and escaping in the run blocks.

The GitHub runners use the bash shell that comes with git for windows. Would it be an option to install that? Or do you want to use powershell on Linux?

@guilhermebodin
Copy link
Author

hmm it probably will. The problem I am having is that when I try to run the action on a windows github runner it complains about not having a WSL installed

  julia --color=yes "$GITHUB_ACTION_PATH"/add_general_registry.jl
  shell: C:\Windows\system32\bash.EXE --noprofile --norc -e -o pipefail {0}
  env:
    JULIA_PKG_SERVER: 
Windows Subsystem for Linux has no installed distributions.

Distributions can be installed by visiting the Microsoft Store:

https://aka.ms/wslstore

@SaschaMann
Copy link
Member

SaschaMann commented Nov 6, 2021

That sounds like it has WSL bash in the PATH rather than Git Bash. The bash.exe in that error message prints that error if WSL isn't installed.

I don't think this is something we can solve in this action but, without being able to test it, perhaps these workarounds could help:

@guilhermebodin
Copy link
Author

I will probably go with one one of them. Thank you @SaschaMann !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants