Compare commits

..

2 Commits

Author SHA1 Message Date
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
12 changed files with 4182 additions and 1078 deletions

View File

@@ -42,11 +42,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.1
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -71,4 +71,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@v3

View File

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

View File

@@ -18,18 +18,18 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: [nightly, 1.13-nightly]
julia-version: [nightly, 1.10-nightly]
os:
- ubuntu-latest
- windows-latest
- macos-15-intel # Intel
- macos-13 # Intel
- macos-14 # Apple Silicon
- macos-latest # Apple Silicon
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
- uses: actions/setup-node@v4
if: ${{ ! startsWith(github.ref, 'refs/heads/releases') }}
with:
node-version-file: '.tool-versions'

View File

@@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: [nightly, 1.13-nightly]
julia-version: [nightly, 1.10-nightly]
julia-arch: [x64, x86]
os: [ubuntu-latest, macOS-latest, windows-latest]
# 32-bit Julia binaries are not available on macOS
@@ -29,9 +29,9 @@ jobs:
julia-arch: x86
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
- uses: actions/setup-node@v4
if: ${{ ! startsWith(github.ref, 'refs/heads/releases') }}
with:
node-version-file: '.tool-versions'

View File

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

View File

@@ -39,21 +39,21 @@ jobs:
fail-fast: false
steps:
### Check out the repo:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Cleanall:
- run: make cleanall
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47
- uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'
# Windows:
# Windows does not support asdf, so we have to use `actions/setup-node`
# to install asdf:
- uses: actions/setup-node@dda4788290998366da86b6a4f497909644397bb2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
if: runner.os == 'Windows'
with:
node-version-file: '.tool-versions'
@@ -82,21 +82,21 @@ jobs:
runs-on: ubuntu-latest
steps:
### Check out the repo:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Cleanall:
- run: make cleanall
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47
- uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'
# Windows:
# Windows does not support asdf, so we have to use `actions/setup-node`
# to install asdf:
- uses: actions/setup-node@dda4788290998366da86b6a4f497909644397bb2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
if: runner.os == 'Windows'
with:
node-version-file: '.tool-versions'
@@ -126,21 +126,21 @@ jobs:
runs-on: ubuntu-latest
steps:
### Check out the repo:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Cleanall:
- run: make cleanall
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47
- uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'
# Windows:
# Windows does not support asdf, so we have to use `actions/setup-node`
# to install asdf:
- uses: actions/setup-node@dda4788290998366da86b6a4f497909644397bb2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
if: runner.os == 'Windows'
with:
node-version-file: '.tool-versions'
@@ -161,14 +161,14 @@ jobs:
runs-on: ubuntu-latest
steps:
### Check out the repo:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Cleanall:
- run: make cleanall
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47
- uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'
@@ -199,12 +199,12 @@ jobs:
fail-fast: false
steps:
### Check out the repo:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47
- uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'

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

29
dist/index.js vendored
View File

@@ -7177,7 +7177,6 @@ const isSatisfiable = (comparators, options) => {
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
const parseComparator = (comp, options) => {
comp = comp.replace(re[t.BUILD], '')
debug('comp', comp, options)
comp = replaceCarets(comp, options)
debug('caret', comp)
@@ -7598,25 +7597,11 @@ class SemVer {
other = new SemVer(other, this.options)
}
if (this.major < other.major) {
return -1
}
if (this.major > other.major) {
return 1
}
if (this.minor < other.minor) {
return -1
}
if (this.minor > other.minor) {
return 1
}
if (this.patch < other.patch) {
return -1
}
if (this.patch > other.patch) {
return 1
}
return 0
return (
compareIdentifiers(this.major, other.major) ||
compareIdentifiers(this.minor, other.minor) ||
compareIdentifiers(this.patch, other.patch)
)
}
comparePre (other) {
@@ -8517,10 +8502,6 @@ module.exports = debug
const numeric = /^[0-9]+$/
const compareIdentifiers = (a, b) => {
if (typeof a === 'number' && typeof b === 'number') {
return a === b ? 0 : a < b ? -1 : 1
}
const anum = numeric.test(a)
const bnum = numeric.test(b)

5140
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -20,18 +20,18 @@
"author": "Sascha Mann <git@mail.saschamann.eu>",
"license": "MIT",
"dependencies": {
"@actions/core": "^3.0.0",
"@actions/exec": "^3.0.0",
"@actions/io": "^3.0.2",
"@actions/tool-cache": "^4.0.0",
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.2",
"async-retry": "^1.3.3",
"semver": "^7.7.4",
"semver": "^7.7.0",
"toml": "^3.0.0"
},
"devDependencies": {
"@types/async-retry": "^1.4.9",
"@types/jest": "^30.0.0",
"@types/node": "^25.2.1",
"@types/node": "^24.1.0",
"@types/retry": "^0.12.5",
"@types/semver": "^7.7.0",
"@vercel/ncc": "^0.38.3",

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;