Add inline input (#4)

* Add `inline` input

* Update main.js

* Update main.ts
This commit is contained in:
Dilum Aluthge
2020-02-26 16:38:46 -05:00
committed by GitHub
parent a27b0328f6
commit e3687f82c8
3 changed files with 8 additions and 14 deletions

View File

@@ -1,6 +1,10 @@
name: 'Run Julia package tests'
description: 'Run the tests in a Julia package'
author: 'David Anthoff'
inputs:
inline:
description: 'Value passed to the --inline flag. Options: yes | no. Default value: yes.'
default: 'yes'
runs:
using: 'node12'
main: 'lib/main.js'

View File

@@ -21,20 +21,9 @@ const exec = __importStar(require("@actions/exec"));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const codecov = core.getInput('codecov');
const coveralls = core.getInput('coveralls');
// Run Pkg.build
yield exec.exec('julia', ['--color=yes', '--project', '-e', 'using Pkg; if VERSION >= v\"1.1.0-rc1\"; Pkg.build(verbose=true); else Pkg.build(); end']);
const inline = core.getInput('inline');
// Run Pkg.test
yield exec.exec('julia', ['--color=yes', '--check-bounds=yes', '--project', '-e', 'using Pkg; Pkg.test(coverage=true)']);
if (codecov == 'true') {
// await exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'])
yield exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/davidanthoff/Coverage.jl.git", rev="githubactions")); using Coverage; Codecov.submit(process_folder())']);
}
if (coveralls == 'true') {
// await exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())'])
yield exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/davidanthoff/Coverage.jl.git", rev="githubactions")); using Coverage; Coveralls.submit(process_folder())']);
}
yield exec.exec('julia', ['--color=yes', '--check-bounds=yes', `--inline=${inline}`, '--project', '-e', 'using Pkg; Pkg.test(coverage=true)']);
}
catch (error) {
core.setFailed(error.message);

View File

@@ -3,8 +3,9 @@ import * as exec from '@actions/exec'
async function run() {
try {
const inline: string = core.getInput('inline')
// Run Pkg.test
await exec.exec('julia', ['--color=yes', '--check-bounds=yes', '--project', '-e', 'using Pkg; Pkg.test(coverage=true)'])
await exec.exec('julia', ['--color=yes', '--check-bounds=yes', `--inline=${inline}`, '--project', '-e', 'using Pkg; Pkg.test(coverage=true)'])
} catch (error) {
core.setFailed(error.message)
}