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

install elan on windows #75

Closed
Seasawher opened this issue Jul 11, 2024 · 4 comments · Fixed by #99
Closed

install elan on windows #75

Seasawher opened this issue Jul 11, 2024 · 4 comments · Fixed by #99
Labels
enhancement New feature or request

Comments

@Seasawher
Copy link
Contributor

Seasawher commented Jul 11, 2024

I have created a workflow running on Windows.

see: https://github.com/lean-ja/lean-by-example/blob/edc6f5e9d023b0f4c4beb26474e1b678b8e9ba5e/.github/workflows/ci.yml#L29

Almost always building on Windows is not necessary, but I sometimes need this. (For example, when trying to provide an environment which reproduce a lean bug on Windows machine...)

@Seasawher
Copy link
Contributor Author

I think there should be a conditional branch that detects the runner OS and installs elan in a different way if it is Windows. How do you think?

@austinletson
Copy link
Collaborator

It would be possible to use conditional logic to achieve this, however, I think it would require rewriting most of the scripts that power most of the functionality of lean-action for a Windows environment since they are written in Bash.

I know some GitHub actions support multiple runner operating systems by writing the action in TypeScript instead of having shell scripts and then using shell scripts for specific OS-specific components, e.g., setup-PHP. There are other advantages to using TypeScript instead of the current lean-action architecture so this could be a worthwhile refactor in the future.

@joneugster
Copy link

My Windows workflow currently reads:

- name: Install elan (Windows)
  if: matrix.os == 'windows-latest'
  run: |
    curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf > elan-init.sh
    bash elan-init.sh -y
    echo "$(realpath ~/.elan/bin)" >> $GITHUB_PATH
  shell: bash
- name: Run lake build (Windows)
  if: matrix.os == 'windows-latest'
  run: |
    cd your/local/folder
    lake build
  shell: bash

Thought I'd post it here for reference as it's using bash instead of powershell which is closer to the existing scripts of the lean action.

@austinletson
Copy link
Collaborator

Thank you for the tip here @joneugster!

I have a PR open to add support for Windows runners. We can use the existing scripts with a slight modification to the call site because of a known issue with GitHub custom actions (link to issue).

Windows runner support should be available in the next week or two with the next release of lean-action.

@austinletson austinletson added the enhancement New feature or request label Sep 4, 2024
austinletson added a commit that referenced this issue Sep 6, 2024
Change `${{ github.action_path }}` to `${GITHUB_ACTION_PATH}` to add
support for Windows runners

Add a functional test on a Windows runner

Closes #75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants