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

Feature request: other architectures #101

Closed dpo closed 2 years ago

dpo commented 2 years ago

It would be useful to select other Julia architectures (e.g., macOS aarch64) to run on self-hosted runners. Would you be open to adding such feature to this action?

SaschaMann commented 2 years ago

Hi, I'm open to adding them. However, I don't have access to any self-hosted runners or aarch64 macOS hardware, which makes adding and testing archs that aren't available through GitHub's hosted runners impossible on my own.

I'm happy to accept PRs or collaborate on adding them if you have access to the required runners/hardware, though.

dpo commented 2 years ago

Great, thank you! Let me try to get a first version going.

SaschaMann commented 2 years ago

Mosè pointed out on Slack that there isn't a GHA runner for M1 yet: https://github.com/actions/runner/issues/805#issuecomment-1132966327

SaschaMann commented 2 years ago

These lines would need changing/additions to add support for it:

https://github.com/julia-actions/setup-julia/blob/f29cb961e8488bf333363f0f325069a721f74dee/src/installer.ts#L19-L22

https://github.com/julia-actions/setup-julia/blob/f29cb961e8488bf333363f0f325069a721f74dee/src/installer.ts#L102-L104

I might have missed something and the README would need an update too, so no guarantee for completeness.

SaschaMann commented 2 years ago

102 should in theory also enable support for M1 runners, though that should be verified once those are actually available. The only thing left for that would be the addition of a new error branch when trying to install nightlies on M1 macOS, since those don't exist.

giordano commented 2 years ago

I successfully tested a self-hosted runner on a Macbook M1 with the new runners v2.292.0. I used this script to test an example package:

name: CI
on:
  push:
    branches: ["*"]
    tags: ["*"]
  pull_request:
jobs:
  test:
    name: Julia ${{ matrix.version }} - macOS - ${{ matrix.arch }} - ${{ github.event_name }}
    runs-on: [self-hosted]
    strategy:
      fail-fast: false
      matrix:
        version:
          - 1.7.2
        arch:
          - aarch64
    steps:
      - uses: actions/checkout@v3
      - uses: julia-actions/setup-julia@v1
        with:
          version: ${{ matrix.version }}
          arch: ${{ matrix.arch }}
      - name: Version Info
        shell: julia --color=yes {0}
        run: |
          using InteractiveUtils
          versioninfo()
      - uses: julia-actions/julia-buildpkg@v1
      - uses: julia-actions/julia-runtest@v1
SaschaMann commented 2 years ago

It doesn't work properly on macOS yet due to permission errors when copying the files from the attached dmg file. I'll debug this another time. For now be warned that this may not work reliably.

giordano commented 2 years ago

I think this problem is orthogonal to the original issue of being able to install aarch64 binaries, though.

SaschaMann commented 2 years ago

Good point, I opened #105

dpo commented 2 years ago

Many thanks for this!!!

I tried with Mosé's script but I get the error in the screenshot. The VersionInfo job doesn't even run.

Screen Shot 2022-06-01 at 12 36 12

Server side, all I see is

% ./run.sh

√ Connected to GitHub

Current runner version: '2.292.0'
2022-06-01 15:47:42Z: Listening for Jobs
2022-06-01 15:48:25Z: Running job: Julia 1.7.3 - macOS - aarch64 - pull_request
2022-06-01 15:48:36Z: Job Julia 1.7.3 - macOS - aarch64 - pull_request completed with result: Failed

Any ideas?

giordano commented 2 years ago

There is no build of Julia v1.7.3 for that architecture. DON'T USE JULIA v1.7 ON THE M1, IT'S BROKEN. I hope the message is clear

dpo commented 2 years ago

I know ;-). I'm testing it. Hence this request.