Compare commits

..

2 Commits

Author SHA1 Message Date
Sascha Mann
d3b756489b Add production dependencies & build 2020-07-30 13:25:08 +02:00
Sascha Mann
aced07b9c9 Fail build when inputs are empty 2020-07-30 13:21:38 +02:00
5 changed files with 40 additions and 2 deletions

12
dist/index.js vendored
View File

@@ -3777,8 +3777,20 @@ const installer = __importStar(__webpack_require__(749));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
// Inputs
const versionInput = core.getInput('version');
const arch = 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.
// We _could_ fall back to the default but that means that builds silently do things differently than they're meant to, which
// is worse than failing the build.
if (!versionInput) {
throw new Error('Version input must not be null');
}
if (!arch) {
throw new Error(`Arch input must not be null`);
}
const availableReleases = installer.juliaVersions;
const version = installer.getJuliaVersion(availableReleases, versionInput);
core.debug(`selected Julia version: ${arch}/${version}`);

12
lib/setup-julia.js generated
View File

@@ -23,8 +23,20 @@ const installer = __importStar(require("./installer"));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
// Inputs
const versionInput = core.getInput('version');
const arch = 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.
// We _could_ fall back to the default but that means that builds silently do things differently than they're meant to, which
// is worse than failing the build.
if (!versionInput) {
throw new Error('Version input must not be null');
}
if (!arch) {
throw new Error(`Arch input must not be null`);
}
const availableReleases = installer.juliaVersions;
const version = installer.getJuliaVersion(availableReleases, versionInput);
core.debug(`selected Julia version: ${arch}/${version}`);

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "setup-julia",
"version": "1.1.10",
"version": "1.1.11",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

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

View File

@@ -8,8 +8,22 @@ import * as installer from './installer'
async function run() {
try {
// Inputs
const versionInput = core.getInput('version')
const arch = 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.
// We _could_ fall back to the default but that means that builds silently do things differently than they're meant to, which
// is worse than failing the build.
if (!versionInput) {
throw new Error('Version input must not be null')
}
if (!arch) {
throw new Error(`Arch input must not be null`)
}
const availableReleases = installer.juliaVersions
const version = installer.getJuliaVersion(availableReleases, versionInput)
core.debug(`selected Julia version: ${arch}/${version}`)