mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-14 03:56:53 +08:00
Compare commits
16 Commits
windows-be
...
v1.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce353a9bc8 | ||
|
|
67db496725 | ||
|
|
800ff44572 | ||
|
|
6966335537 | ||
|
|
f29cb961e8 | ||
|
|
b69122e25a | ||
|
|
1777cc3f15 | ||
|
|
2bb1080a55 | ||
|
|
2d69597029 | ||
|
|
f577b7c336 | ||
|
|
a12d4d2f6d | ||
|
|
3dcf5f495f | ||
|
|
f473b6b037 | ||
|
|
afa5e14af0 | ||
|
|
01d5d7138b | ||
|
|
6fd5c3fbaf |
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: gitsubmodule
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
open-pull-requests-limit: 10
|
||||||
2
.github/workflows/example-builds-nightly.yml
vendored
2
.github/workflows/example-builds-nightly.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
julia-version: [nightly, 1.6-nightly]
|
julia-version: [nightly, 1.8-nightly]
|
||||||
julia-arch: [x64, x86]
|
julia-arch: [x64, x86]
|
||||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||||
# 32-bit Julia binaries are not available on macOS
|
# 32-bit Julia binaries are not available on macOS
|
||||||
|
|||||||
1
.github/workflows/example-builds.yml
vendored
1
.github/workflows/example-builds.yml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ['main', 'master', 'releases/*']
|
branches: ['main', 'master', 'releases/*']
|
||||||
pull_request:
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
|||||||
44
.github/workflows/windows-tests.yml
vendored
44
.github/workflows/windows-tests.yml
vendored
@@ -1,44 +0,0 @@
|
|||||||
name: Windows Benchmark
|
|
||||||
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
installer:
|
|
||||||
name: Installer
|
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Download
|
|
||||||
run: curl -O https://julialang-s3.julialang.org/bin/winnt/x64/1.5/julia-1.5.3-win64.exe
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Install
|
|
||||||
run: |
|
|
||||||
Start-Process -FilePath julia-1.5.3-win64.exe -ArgumentList "/SILENT /dir=C:\Julia" -NoNewWindow -Wait
|
|
||||||
|
|
||||||
- name: Add to path
|
|
||||||
run: |
|
|
||||||
echo "C:\Julia\bin" >> $GITHUB_PATH
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- run: julia --version
|
|
||||||
|
|
||||||
archive:
|
|
||||||
name: Archive
|
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Download
|
|
||||||
run: curl -O https://julialang-s3.julialang.org/bin/winnt/x64/1.5/julia-1.5.3-win64.zip
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Install
|
|
||||||
run: |
|
|
||||||
[System.IO.Compression.ZipFile]::ExtractToDirectory('julia-1.5.3-win64.zip', 'C:\Julia')
|
|
||||||
|
|
||||||
- name: Add to path
|
|
||||||
run: |
|
|
||||||
echo "C:\Julia\julia-1.5.3\bin" >> $GITHUB_PATH
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- run: julia --version
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,3 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
__tests__/runner/*
|
__tests__/runner/*
|
||||||
dist/
|
!dist/
|
||||||
|
|||||||
@@ -38,7 +38,11 @@ This action sets up a Julia environment for use in actions by downloading a spec
|
|||||||
|
|
||||||
# The architecture of the Julia binaries.
|
# The architecture of the Julia binaries.
|
||||||
#
|
#
|
||||||
# Supported values: x64 | x86
|
# Please note that installing aarch64 binaries only makes sense on self-hosted aarch64 runners.
|
||||||
|
# We currently don't run test builds on that architecture, so we cannot guarantee that the input won't break randomly,
|
||||||
|
# although there is no reason why it would.
|
||||||
|
#
|
||||||
|
# Supported values: x64 | x86 | aarch64 (untested)
|
||||||
#
|
#
|
||||||
# Default: x64
|
# Default: x64
|
||||||
arch: ''
|
arch: ''
|
||||||
@@ -103,7 +107,7 @@ You can either specify specific Julia versions or version ranges. If you specify
|
|||||||
- `^1.3.0-0` is a **caret** version range that includes _all_ pre-releases. It matches all versions `≥ 1.3.0-` and `< 2.0.0`.
|
- `^1.3.0-0` is a **caret** version range that includes _all_ pre-releases. It matches all versions `≥ 1.3.0-` and `< 2.0.0`.
|
||||||
- `~1.3.0-0` is a **tilde** version range that includes _all_ pre-releases. It matches all versions `≥ 1.3.0-` and `< 1.4.0`.
|
- `~1.3.0-0` is a **tilde** version range that includes _all_ pre-releases. It matches all versions `≥ 1.3.0-` and `< 1.4.0`.
|
||||||
- `nightly` will install the latest nightly build.
|
- `nightly` will install the latest nightly build.
|
||||||
- `1.6-nightly` will install the latest nightly build for the upcoming 1.6 release. This version will only be available during certain phases of the Julia release cycle.
|
- `1.7-nightly` will install the latest nightly build for the upcoming 1.7 release. This version will only be available during certain phases of the Julia release cycle.
|
||||||
|
|
||||||
Internally the action uses node's semver package to resolve version ranges. Its [documentation](https://github.com/npm/node-semver#advanced-range-syntax) contains more details on the version range syntax. You can test what version will be selected for a given input in this JavaScript [REPL](https://repl.it/@SaschaMann/setup-julia-version-logic).
|
Internally the action uses node's semver package to resolve version ranges. Its [documentation](https://github.com/npm/node-semver#advanced-range-syntax) contains more details on the version range syntax. You can test what version will be selected for a given input in this JavaScript [REPL](https://repl.it/@SaschaMann/setup-julia-version-logic).
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ outputs:
|
|||||||
julia-bindir:
|
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'
|
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:
|
runs:
|
||||||
using: 'node12'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'download'
|
icon: 'download'
|
||||||
|
|||||||
5204
dist/index.js
vendored
Normal file
5204
dist/index.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
dist/unzip
vendored
Normal file
BIN
dist/unzip
vendored
Normal file
Binary file not shown.
13
lib/installer.js
generated
13
lib/installer.js
generated
@@ -32,7 +32,8 @@ const osMap = {
|
|||||||
};
|
};
|
||||||
const archMap = {
|
const archMap = {
|
||||||
'x86': 'i686',
|
'x86': 'i686',
|
||||||
'x64': 'x86_64'
|
'x64': 'x86_64',
|
||||||
|
'aarch64': 'aarch64'
|
||||||
};
|
};
|
||||||
// Store information about the environment
|
// Store information about the environment
|
||||||
const osPlat = os.platform(); // possible values: win32 (Windows), linux (Linux), darwin (macOS)
|
const osPlat = os.platform(); // possible values: win32 (Windows), linux (Linux), darwin (macOS)
|
||||||
@@ -124,15 +125,19 @@ function getNightlyFileName(arch) {
|
|||||||
return `julia-latest${versionExt}.${ext}`;
|
return `julia-latest${versionExt}.${ext}`;
|
||||||
}
|
}
|
||||||
function getFileInfo(versionInfo, version, arch) {
|
function getFileInfo(versionInfo, version, arch) {
|
||||||
|
const err = `Could not find ${archMap[arch]}/${version} binaries`;
|
||||||
if (version.endsWith('nightly')) {
|
if (version.endsWith('nightly')) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (!versionInfo[version]) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
for (let file of versionInfo[version].files) {
|
for (let file of versionInfo[version].files) {
|
||||||
if (file.os == osMap[osPlat] && file.arch == archMap[arch]) {
|
if (file.os == osMap[osPlat] && file.arch == archMap[arch]) {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw `Could not find ${archMap[arch]}/${version} binaries`;
|
throw err;
|
||||||
}
|
}
|
||||||
exports.getFileInfo = getFileInfo;
|
exports.getFileInfo = getFileInfo;
|
||||||
function getDownloadURL(fileInfo, version, arch) {
|
function getDownloadURL(fileInfo, version, arch) {
|
||||||
@@ -146,6 +151,10 @@ function getDownloadURL(fileInfo, version, arch) {
|
|||||||
if (version == 'nightly') {
|
if (version == 'nightly') {
|
||||||
return `${baseURL}/${getNightlyFileName(arch)}`;
|
return `${baseURL}/${getNightlyFileName(arch)}`;
|
||||||
}
|
}
|
||||||
|
// Verify that fileInfo.url points at the official Julia download servers
|
||||||
|
if (!fileInfo.url.startsWith('https://julialang-s3.julialang.org/')) {
|
||||||
|
throw new Error(`versions.json points at a download location outside of Julia's download server: ${fileInfo.url}. Aborting for security reasons.`);
|
||||||
|
}
|
||||||
return fileInfo.url;
|
return fileInfo.url;
|
||||||
}
|
}
|
||||||
exports.getDownloadURL = getDownloadURL;
|
exports.getDownloadURL = getDownloadURL;
|
||||||
|
|||||||
8557
package-lock.json
generated
8557
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-julia",
|
"name": "setup-julia",
|
||||||
"version": "1.6.0",
|
"version": "1.7.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "setup Julia action",
|
"description": "setup Julia action",
|
||||||
"main": "lib/setup-julia.js",
|
"main": "lib/setup-julia.js",
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ const osMap = {
|
|||||||
}
|
}
|
||||||
const archMap = {
|
const archMap = {
|
||||||
'x86': 'i686',
|
'x86': 'i686',
|
||||||
'x64': 'x86_64'
|
'x64': 'x86_64',
|
||||||
|
'aarch64': 'aarch64'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store information about the environment
|
// Store information about the environment
|
||||||
@@ -115,17 +116,23 @@ function getNightlyFileName(arch: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getFileInfo(versionInfo, version: string, arch: string) {
|
export function getFileInfo(versionInfo, version: string, arch: string) {
|
||||||
|
const err = `Could not find ${archMap[arch]}/${version} binaries`
|
||||||
|
|
||||||
if (version.endsWith('nightly')) {
|
if (version.endsWith('nightly')) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!versionInfo[version]) {
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
|
||||||
for (let file of versionInfo[version].files) {
|
for (let file of versionInfo[version].files) {
|
||||||
if (file.os == osMap[osPlat] && file.arch == archMap[arch]) {
|
if (file.os == osMap[osPlat] && file.arch == archMap[arch]) {
|
||||||
return file
|
return file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw `Could not find ${archMap[arch]}/${version} binaries`
|
throw err
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDownloadURL(fileInfo, version: string, arch: string): string {
|
export function getDownloadURL(fileInfo, version: string, arch: string): string {
|
||||||
@@ -142,6 +149,10 @@ export function getDownloadURL(fileInfo, version: string, arch: string): string
|
|||||||
return `${baseURL}/${getNightlyFileName(arch)}`
|
return `${baseURL}/${getNightlyFileName(arch)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify that fileInfo.url points at the official Julia download servers
|
||||||
|
if (!fileInfo.url.startsWith('https://julialang-s3.julialang.org/')) {
|
||||||
|
throw new Error(`versions.json points at a download location outside of Julia's download server: ${fileInfo.url}. Aborting for security reasons.`)
|
||||||
|
}
|
||||||
return fileInfo.url
|
return fileInfo.url
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,12 +211,12 @@ export async function installJulia(versionInfo, version: string, arch: string):
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if Julia has been installed and print the version.
|
* Test if Julia has been installed and print the version.
|
||||||
*
|
*
|
||||||
* true => always show versioninfo
|
* true => always show versioninfo
|
||||||
* false => only show on nightlies
|
* false => only show on nightlies
|
||||||
* never => never show it anywhere
|
* never => never show it anywhere
|
||||||
*
|
*
|
||||||
* @param showVersionInfoInput
|
* @param showVersionInfoInput
|
||||||
*/
|
*/
|
||||||
export async function showVersionInfo(showVersionInfoInput: string, version: string): Promise<void> {
|
export async function showVersionInfo(showVersionInfoInput: string, version: string): Promise<void> {
|
||||||
// --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s
|
// --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s
|
||||||
@@ -215,7 +226,7 @@ export async function showVersionInfo(showVersionInfoInput: string, version: str
|
|||||||
case 'true':
|
case 'true':
|
||||||
exitCode = await exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()'])
|
exitCode = await exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()'])
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'false':
|
case 'false':
|
||||||
if (version.endsWith('nightly')) {
|
if (version.endsWith('nightly')) {
|
||||||
exitCode = await exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()'])
|
exitCode = await exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()'])
|
||||||
@@ -223,7 +234,7 @@ export async function showVersionInfo(showVersionInfoInput: string, version: str
|
|||||||
exitCode = await exec.exec('julia', ['--version'])
|
exitCode = await exec.exec('julia', ['--version'])
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'never':
|
case 'never':
|
||||||
exitCode = await exec.exec('julia', ['--version'])
|
exitCode = await exec.exec('julia', ['--version'])
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user