From 9fe8d30582c187129b1a1dd1fa9b86ff01332b90 Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Sun, 15 Sep 2019 10:52:10 -0700 Subject: [PATCH] Add support for codecov --- lib/main.js | 14 ++++++-------- src/main.ts | 7 ++++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/main.js b/lib/main.js index 18725d6..6e42299 100644 --- a/lib/main.js +++ b/lib/main.js @@ -18,21 +18,19 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(require("@actions/core")); const exec = __importStar(require("@actions/exec")); -const os = __importStar(require("os")); -// Store information about the environment -const osPlat = os.platform(); // possible values: win32 (Windows), linux (Linux), darwin (macOS) -core.debug(`platform: ${osPlat}`); function run() { return __awaiter(this, void 0, void 0, function* () { try { const codecov = core.getInput('codecov'); const coveralls = core.getInput('coveralls'); - // Test if Julia has been installed by showing versioninfo() + // 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 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())']) - // } + 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(PkgSpec(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())']) // } diff --git a/src/main.ts b/src/main.ts index 5c10554..740f79b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,9 +12,10 @@ async function run() { // Run Pkg.test await 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())']) - // } + if(codecov=='true') { + // await exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())']) + await exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add(PkgSpec(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())'])