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'
|
name: 'Run Julia package tests'
|
||||||
description: 'Run the tests in a Julia package'
|
description: 'Run the tests in a Julia package'
|
||||||
author: 'David Anthoff'
|
author: 'David Anthoff'
|
||||||
|
inputs:
|
||||||
|
inline:
|
||||||
|
description: 'Value passed to the --inline flag. Options: yes | no. Default value: yes.'
|
||||||
|
default: 'yes'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'lib/main.js'
|
main: 'lib/main.js'
|
||||||
|
|||||||
15
lib/main.js
15
lib/main.js
@@ -21,20 +21,9 @@ const exec = __importStar(require("@actions/exec"));
|
|||||||
function run() {
|
function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
const codecov = core.getInput('codecov');
|
const inline = core.getInput('inline');
|
||||||
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']);
|
|
||||||
// Run Pkg.test
|
// Run Pkg.test
|
||||||
yield exec.exec('julia', ['--color=yes', '--check-bounds=yes', '--project', '-e', 'using Pkg; Pkg.test(coverage=true)']);
|
yield exec.exec('julia', ['--color=yes', '--check-bounds=yes', `--inline=${inline}`, '--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())']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ import * as exec from '@actions/exec'
|
|||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
|
const inline: string = core.getInput('inline')
|
||||||
// Run Pkg.test
|
// 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) {
|
} catch (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user