mirror of
https://github.com/julia-actions/julia-buildpkg.git
synced 2026-02-12 09:26:54 +08:00
Add support for codecov
This commit is contained in:
12
lib/main.js
12
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') {
|
||||
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())'])
|
||||
// }
|
||||
|
||||
@@ -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') {
|
||||
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())'])
|
||||
|
||||
Reference in New Issue
Block a user