Compare commits

...

9 Commits
v1.7 ... v1.8.1

Author SHA1 Message Date
Sascha Mann
5113fd16e9 Add production dependencies & build 2022-06-25 09:29:07 +02:00
Sascha Mann
ffea8bb089 Bump version 2022-06-25 09:28:02 +02:00
Dilum Aluthge
3a89763b86 Fix the "default arch" code path with Julia nightly (and add a CI job for that code path) (#115) 2022-06-25 09:26:39 +02:00
Sascha Mann
40f50bc31f Bump version 2022-06-24 14:44:52 +02:00
Dilum Aluthge
8474f0e14d Default to ${{ runner.arch }} instead of to x64 (#114)
* If the user does not specify the `arch` input, default to `${{ runner.arch }}` (instead of defaulting to `x64`)

* Add a CI workflow that tests the default arch (i.e. tests what happens when the user does not specify the `arch` input)
2022-06-24 14:39:02 +02:00
Dilum Aluthge
76f26cb710 Document the architecture synonyms (#113) 2022-06-23 23:04:54 +00:00
Dilum Aluthge
40ab89a96a Allow X64 and X86 as synonyms for x64 and x86, respectively (#108) 2022-06-23 22:26:05 +00:00
Dilum Aluthge
631e68d88a Allow ARM64 as a synonym for aarch64 (#110) 2022-06-23 20:00:43 +02:00
Sascha Mann
a07a9b4c49 Use --legacy-peer-deps to avoid npm bullshit (#112) 2022-06-20 18:34:11 -04:00
16 changed files with 5363 additions and 22 deletions

View File

@@ -9,6 +9,7 @@ on:
jobs:
backup:
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Configure cache

View File

@@ -1,14 +1,21 @@
name: "PR Checks"
on: [pull_request, push]
concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
check_pr:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v1
- name: "npm ci"
run: npm ci
run: npm ci --legacy-peer-deps
- name: "npm run build"
run: npm run build

View File

@@ -11,6 +11,12 @@
#
name: "CodeQL"
concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
on:
push:
branches: [ master, releases/* ]
@@ -24,6 +30,7 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false

View File

@@ -0,0 +1,40 @@
name: Example builds (default arch)
concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
on:
push:
branches: ['main', 'master', 'releases/*']
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
julia-version: ['1']
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v1.0.0
- name: "Install dependencies"
run: |
npm install --legacy-peer-deps
npm run build
npm run pack
- name: "Set up Julia"
id: setup-julia
uses: ./
with:
version: ${{ matrix.julia-version }}
- run: julia --version
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'

View File

@@ -0,0 +1,38 @@
name: Example builds (nightly, default arch)
concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
on:
push:
branches: ['main', 'master', 'releases/*']
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
julia-version: [nightly, 1.8-nightly]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v1.0.0
- name: "Install dependencies"
run: |
npm install --legacy-peer-deps
npm run build
npm run pack
- name: "Set up Julia (${{ matrix.julia-version }})"
uses: ./
with:
version: ${{ matrix.julia-version }}
- run: julia --version
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'

View File

@@ -1,5 +1,11 @@
name: Example builds (nightly)
concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
on:
push:
branches: ['main', 'master', 'releases/*']
@@ -10,6 +16,7 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -20,13 +27,13 @@ jobs:
exclude:
- os: macOS-latest
julia-arch: x86
steps:
- uses: actions/checkout@v1.0.0
- name: "Install dependencies"
run: |
npm install
npm install --legacy-peer-deps
npm run build
npm run pack

View File

@@ -1,5 +1,11 @@
name: Example builds
concurrency:
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
on:
push:
branches: ['main', 'master', 'releases/*']
@@ -9,6 +15,7 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -19,13 +26,13 @@ jobs:
exclude:
- os: macOS-latest
julia-arch: x86
steps:
- uses: actions/checkout@v1.0.0
- name: "Install dependencies"
run: |
npm install
npm install --legacy-peer-deps
npm run build
npm run pack

2
.gitignore vendored
View File

@@ -1,3 +1,3 @@
node_modules/
__tests__/runner/*
dist/
!dist/

View File

@@ -44,7 +44,9 @@ This action sets up a Julia environment for use in actions by downloading a spec
#
# Supported values: x64 | x86 | aarch64 (untested)
#
# Default: x64
# Note: you can use X64, X86, and ARM64 as synonyms for x64, x86, and aarch64, respectively.
#
# Defaults to the architecture of the runner executing the job.
arch: ''
# Set the display setting for printing InteractiveUtils.versioninfo() after installing.
@@ -127,7 +129,7 @@ jobs:
matrix:
julia-version: ['1.0', '1.2.0', '^1.3.0-rc1']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1.0.0
- name: "Set up Julia"
@@ -153,7 +155,7 @@ jobs:
exclude:
- os: macOS-latest
julia-arch: x86
steps:
- uses: actions/checkout@v1.0.0
- name: "Set up Julia"
@@ -180,7 +182,7 @@ jobs:
- os: windows-latest
julia-version: ['1.0.4']
julia-arch: x86
steps:
- uses: actions/checkout@v1.0.0
- name: "Set up Julia"

View File

@@ -6,9 +6,9 @@ inputs:
description: 'The Julia version to download (if necessary) and use. Example: 1.0.4'
default: '1'
arch:
description: 'Architecture of the Julia binaries. Defaults to x64.'
description: 'Architecture of the Julia binaries. Defaults to the architecture of the runner executing the job.'
required: false
default: 'x64'
default: '${{ runner.arch }}'
show-versioninfo:
description: 'Display InteractiveUtils.versioninfo() after installing'
required: false

5213
dist/index.js vendored Normal file

File diff suppressed because it is too large Load Diff

BIN
dist/unzip vendored Normal file

Binary file not shown.

13
lib/setup-julia.js generated
View File

@@ -21,6 +21,14 @@ const fs = __importStar(require("fs"));
const https = __importStar(require("https"));
const path = __importStar(require("path"));
const installer = __importStar(require("./installer"));
const archSynonyms = {
'x86': 'x86',
'X86': 'x86',
'x64': 'x64',
'X64': 'x64',
'aarch64': 'aarch64',
'ARM64': 'aarch64'
};
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
@@ -41,7 +49,7 @@ function run() {
}
// Inputs
const versionInput = core.getInput('version');
const arch = core.getInput('arch');
const originalArchInput = core.getInput('arch');
// It can easily happen that, for example, a workflow file contains an input `version: ${{ matrix.julia-version }}`
// while the strategy matrix only contains a key `${{ matrix.version }}`.
// In that case, we want the action to fail, rather than trying to download julia from an URL that's missing parts and 404ing.
@@ -50,9 +58,10 @@ function run() {
if (!versionInput) {
throw new Error('Version input must not be null');
}
if (!arch) {
if (!originalArchInput) {
throw new Error(`Arch input must not be null`);
}
const arch = archSynonyms[originalArchInput];
const versionInfo = yield installer.getJuliaVersionInfo();
const availableReleases = yield installer.getJuliaVersions(versionInfo);
const version = installer.getJuliaVersion(availableReleases, versionInput);

7
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "setup-julia",
"version": "1.7.1",
"version": "1.8.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "setup-julia",
"version": "1.6.1",
"version": "1.8.1",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6",
@@ -12927,8 +12927,7 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz",
"integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==",
"dev": true,
"requires": {}
"dev": true
},
"jest-regex-util": {
"version": "24.3.0",

View File

@@ -1,6 +1,6 @@
{
"name": "setup-julia",
"version": "1.7.1",
"version": "1.8.1",
"private": true,
"description": "setup Julia action",
"main": "lib/setup-julia.js",

View File

@@ -8,6 +8,15 @@ import * as path from 'path'
import * as installer from './installer'
const archSynonyms = {
'x86': 'x86',
'X86': 'x86',
'x64': 'x64',
'X64': 'x64',
'aarch64': 'aarch64',
'ARM64': 'aarch64'
}
async function run() {
try {
// Debugging info
@@ -30,7 +39,7 @@ async function run() {
// Inputs
const versionInput = core.getInput('version')
const arch = core.getInput('arch')
const originalArchInput = core.getInput('arch')
// It can easily happen that, for example, a workflow file contains an input `version: ${{ matrix.julia-version }}`
// while the strategy matrix only contains a key `${{ matrix.version }}`.
@@ -40,10 +49,12 @@ async function run() {
if (!versionInput) {
throw new Error('Version input must not be null')
}
if (!arch) {
if (!originalArchInput) {
throw new Error(`Arch input must not be null`)
}
const arch = archSynonyms[originalArchInput]
const versionInfo = await installer.getJuliaVersionInfo()
const availableReleases = await installer.getJuliaVersions(versionInfo)
const version = installer.getJuliaVersion(availableReleases, versionInput)