mirror of
https://github.com/julia-actions/julia-runtest.git
synced 2026-02-12 02:56:55 +08:00
Add inline input (#4)
* Add `inline` input * Update main.js * Update main.ts
This commit is contained in:
@@ -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'
|
||||
|
||||
15
lib/main.js
15
lib/main.js
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user