mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-12 02:56:54 +08:00
Fix the "default arch" code path with Julia nightly (and add a CI job for that code path) (#115)
This commit is contained in:
1
.github/workflows/backup.yml
vendored
1
.github/workflows/backup.yml
vendored
@@ -9,6 +9,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
backup:
|
backup:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
timeout-minutes: 60
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Configure cache
|
- name: Configure cache
|
||||||
|
|||||||
7
.github/workflows/checkin.yml
vendored
7
.github/workflows/checkin.yml
vendored
@@ -1,9 +1,16 @@
|
|||||||
name: "PR Checks"
|
name: "PR Checks"
|
||||||
on: [pull_request, push]
|
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:
|
jobs:
|
||||||
check_pr:
|
check_pr:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 60
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
|||||||
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
@@ -11,6 +11,12 @@
|
|||||||
#
|
#
|
||||||
name: "CodeQL"
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master, releases/* ]
|
branches: [ master, releases/* ]
|
||||||
@@ -24,6 +30,7 @@ jobs:
|
|||||||
analyze:
|
analyze:
|
||||||
name: Analyze
|
name: Analyze
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 60
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
name: Example builds (default arch)
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main', 'master', 'releases/*']
|
branches: ['main', 'master', 'releases/*']
|
||||||
@@ -9,6 +15,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
38
.github/workflows/example-builds-nightly-defaultarch.yml
vendored
Normal file
38
.github/workflows/example-builds-nightly-defaultarch.yml
vendored
Normal 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()'
|
||||||
7
.github/workflows/example-builds-nightly.yml
vendored
7
.github/workflows/example-builds-nightly.yml
vendored
@@ -1,5 +1,11 @@
|
|||||||
name: Example builds (nightly)
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main', 'master', 'releases/*']
|
branches: ['main', 'master', 'releases/*']
|
||||||
@@ -10,6 +16,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
7
.github/workflows/example-builds.yml
vendored
7
.github/workflows/example-builds.yml
vendored
@@ -1,5 +1,11 @@
|
|||||||
name: Example builds
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main', 'master', 'releases/*']
|
branches: ['main', 'master', 'releases/*']
|
||||||
@@ -9,6 +15,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
5
lib/installer.js
generated
5
lib/installer.js
generated
@@ -32,11 +32,8 @@ const osMap = {
|
|||||||
};
|
};
|
||||||
const archMap = {
|
const archMap = {
|
||||||
'x86': 'i686',
|
'x86': 'i686',
|
||||||
'X86': 'i686',
|
|
||||||
'x64': 'x86_64',
|
'x64': 'x86_64',
|
||||||
'X64': 'x86_64',
|
'aarch64': 'aarch64'
|
||||||
'aarch64': 'aarch64',
|
|
||||||
'ARM64': '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)
|
||||||
|
|||||||
13
lib/setup-julia.js
generated
13
lib/setup-julia.js
generated
@@ -21,6 +21,14 @@ const fs = __importStar(require("fs"));
|
|||||||
const https = __importStar(require("https"));
|
const https = __importStar(require("https"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
const installer = __importStar(require("./installer"));
|
const installer = __importStar(require("./installer"));
|
||||||
|
const archSynonyms = {
|
||||||
|
'x86': 'x86',
|
||||||
|
'X86': 'x86',
|
||||||
|
'x64': 'x64',
|
||||||
|
'X64': 'x64',
|
||||||
|
'aarch64': 'aarch64',
|
||||||
|
'ARM64': 'aarch64'
|
||||||
|
};
|
||||||
function run() {
|
function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
@@ -41,7 +49,7 @@ function run() {
|
|||||||
}
|
}
|
||||||
// Inputs
|
// Inputs
|
||||||
const versionInput = core.getInput('version');
|
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 }}`
|
// 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 }}`.
|
// 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.
|
// 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) {
|
if (!versionInput) {
|
||||||
throw new Error('Version input must not be null');
|
throw new Error('Version input must not be null');
|
||||||
}
|
}
|
||||||
if (!arch) {
|
if (!originalArchInput) {
|
||||||
throw new Error(`Arch input must not be null`);
|
throw new Error(`Arch input must not be null`);
|
||||||
}
|
}
|
||||||
|
const arch = archSynonyms[originalArchInput];
|
||||||
const versionInfo = yield installer.getJuliaVersionInfo();
|
const versionInfo = yield installer.getJuliaVersionInfo();
|
||||||
const availableReleases = yield installer.getJuliaVersions(versionInfo);
|
const availableReleases = yield installer.getJuliaVersions(versionInfo);
|
||||||
const version = installer.getJuliaVersion(availableReleases, versionInput);
|
const version = installer.getJuliaVersion(availableReleases, versionInput);
|
||||||
|
|||||||
@@ -18,11 +18,8 @@ const osMap = {
|
|||||||
}
|
}
|
||||||
const archMap = {
|
const archMap = {
|
||||||
'x86': 'i686',
|
'x86': 'i686',
|
||||||
'X86': 'i686',
|
|
||||||
'x64': 'x86_64',
|
'x64': 'x86_64',
|
||||||
'X64': 'x86_64',
|
'aarch64': 'aarch64'
|
||||||
'aarch64': 'aarch64',
|
|
||||||
'ARM64': 'aarch64'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store information about the environment
|
// Store information about the environment
|
||||||
|
|||||||
@@ -8,6 +8,15 @@ import * as path from 'path'
|
|||||||
|
|
||||||
import * as installer from './installer'
|
import * as installer from './installer'
|
||||||
|
|
||||||
|
const archSynonyms = {
|
||||||
|
'x86': 'x86',
|
||||||
|
'X86': 'x86',
|
||||||
|
'x64': 'x64',
|
||||||
|
'X64': 'x64',
|
||||||
|
'aarch64': 'aarch64',
|
||||||
|
'ARM64': 'aarch64'
|
||||||
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
// Debugging info
|
// Debugging info
|
||||||
@@ -30,7 +39,7 @@ async function run() {
|
|||||||
|
|
||||||
// Inputs
|
// Inputs
|
||||||
const versionInput = core.getInput('version')
|
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 }}`
|
// 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 }}`.
|
// while the strategy matrix only contains a key `${{ matrix.version }}`.
|
||||||
@@ -40,10 +49,12 @@ async function run() {
|
|||||||
if (!versionInput) {
|
if (!versionInput) {
|
||||||
throw new Error('Version input must not be null')
|
throw new Error('Version input must not be null')
|
||||||
}
|
}
|
||||||
if (!arch) {
|
if (!originalArchInput) {
|
||||||
throw new Error(`Arch input must not be null`)
|
throw new Error(`Arch input must not be null`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const arch = archSynonyms[originalArchInput]
|
||||||
|
|
||||||
const versionInfo = await installer.getJuliaVersionInfo()
|
const versionInfo = await installer.getJuliaVersionInfo()
|
||||||
const availableReleases = await installer.getJuliaVersions(versionInfo)
|
const availableReleases = await installer.getJuliaVersions(versionInfo)
|
||||||
const version = installer.getJuliaVersion(availableReleases, versionInput)
|
const version = installer.getJuliaVersion(availableReleases, versionInput)
|
||||||
|
|||||||
Reference in New Issue
Block a user