Compare commits

..

3 Commits

Author SHA1 Message Date
Viral B. Shah
8b2e6ccf39 Merge branch 'master' into ib/force_arch 2026-03-01 23:52:53 -05:00
Ian Butterworth
60d0df7300 Update src/setup-julia.ts 2025-10-03 09:38:45 -04:00
Ian Butterworth
ab8c34a8eb require opt-in via force-arch to run x86 on macOS arm 2025-10-03 08:55:43 -04:00
9 changed files with 33 additions and 12 deletions

View File

@@ -42,7 +42,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
uses: actions/checkout@v6.0.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@@ -23,7 +23,7 @@ jobs:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v6.0.1
- uses: actions/setup-node@v6
if: ${{ ! startsWith(github.ref, 'refs/heads/releases') }}

View File

@@ -27,7 +27,7 @@ jobs:
- macos-latest # Apple Silicon
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v6.0.1
- uses: actions/setup-node@v6
if: ${{ ! startsWith(github.ref, 'refs/heads/releases') }}

View File

@@ -29,7 +29,7 @@ jobs:
julia-arch: x86
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v6.0.1
- uses: actions/setup-node@v6
if: ${{ ! startsWith(github.ref, 'refs/heads/releases') }}

View File

@@ -36,7 +36,7 @@ jobs:
julia-version: '1'
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v6.0.1
- uses: actions/setup-node@v6
if: ${{ ! startsWith(github.ref, 'refs/heads/releases') }}

View File

@@ -39,7 +39,7 @@ jobs:
fail-fast: false
steps:
### Check out the repo:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
persist-credentials: false
### Cleanall:
@@ -82,7 +82,7 @@ jobs:
runs-on: ubuntu-latest
steps:
### Check out the repo:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
persist-credentials: false
### Cleanall:
@@ -126,7 +126,7 @@ jobs:
runs-on: ubuntu-latest
steps:
### Check out the repo:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
persist-credentials: false
### Cleanall:
@@ -161,7 +161,7 @@ jobs:
runs-on: ubuntu-latest
steps:
### Check out the repo:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
persist-credentials: false
### Cleanall:
@@ -199,7 +199,7 @@ jobs:
fail-fast: false
steps:
### Check out the repo:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
persist-credentials: false
### Install NodeJS

View File

@@ -56,6 +56,18 @@ This action sets up a Julia environment for use in actions by downloading a spec
# Specifying 'default' uses the architecture of the runner executing the job.
arch: 'default'
# Force the use of the specified architecture even when it may be suboptimal on the runner.
#
# By default, requesting x86 or x64 on an aarch64 macOS runner (Apple Silicon) will fail with an error,
# as this is usually a misconfiguration. Set this to 'true' to override the error and allow the installation.
#
# Note: x64 Julia can run on Apple Silicon via Rosetta 2, but native aarch64 is typically preferred.
#
# Supported values: true | false
#
# Default: false
force-arch: 'false'
# Set the display setting for printing InteractiveUtils.versioninfo() after installing.
#
# Starting Julia and running InteractiveUtils.versioninfo() takes a significant amount of time (1s or ~10% of the total build time in testing),

View File

@@ -13,6 +13,10 @@ inputs:
description: 'Architecture of the Julia binaries. Defaults to the architecture of the runner executing the job.'
required: false
default: 'default'
force-arch:
description: 'Force the use of the specified architecture even when it may be suboptimal on the runner (e.g., x86 on Apple Silicon macOS runners). By default, requesting x86/x64 on aarch64 macOS runners will fail with an error.'
required: false
default: 'false'
show-versioninfo:
description: 'Display InteractiveUtils.versioninfo() after installing'
required: false
@@ -27,7 +31,7 @@ outputs:
julia-bindir:
description: 'Path to the directory containing the Julia executable. Equivalent to JULIA_BINDIR: https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_BINDIR'
runs:
using: 'node24'
using: 'node20'
main: 'dist/index.js'
branding:
icon: 'download'

View File

@@ -45,6 +45,7 @@ async function run() {
const versionInput = core.getInput('version').trim()
const includePrereleases = core.getInput('include-all-prereleases').trim() == 'true'
const originalArchInput = core.getInput('arch').trim()
const forceArch = core.getInput('force-arch').trim() == 'true'
const projectInput = core.getInput('project').trim() // Julia project file
// It can easily happen that, for example, a workflow file contains an input `version: ${{ matrix.julia-version }}`
@@ -63,7 +64,11 @@ async function run() {
}
if (originalArchInput == 'x64' && os.platform() == 'darwin' && os.arch() == 'arm64') {
core.warning('[setup-julia] x64 arch has been requested on a macOS runner that has an arm64 (Apple Silicon) architecture. You may have meant to use the "aarch64" arch instead (or left it unspecified for the correct default).')
if (forceArch) {
core.warning('[setup-julia] x64 arch has been requested on a macOS runner that has an arm64 (Apple Silicon) architecture. The "force-arch" input is set to "true", so proceeding with x64 installation. Note that this will mean Julia will be run under Rosetta emulation.')
} else {
throw new Error('[setup-julia] x64 arch has been requested on a macOS runner that has an arm64 (Apple Silicon) architecture. You may have meant to use the "aarch64" arch instead (or "default" or left it unspecified for the correct default). To force the use of x64 on this runner, set the "force-arch" input to "true".')
}
}
let processedArchInput: string;