Update code

This commit is contained in:
David Anthoff
2020-03-23 11:42:52 -07:00
parent 892ec10baa
commit 95b335e1f9
4 changed files with 1469 additions and 243 deletions

1675
dist/index.js vendored

File diff suppressed because it is too large Load Diff

11
src/main.jl Normal file
View File

@@ -0,0 +1,11 @@
using Pkg
Pkg.activate("coveragetempenv", shared=true)
Pkg.add(PackageSpec(name="CoverageTools"))
using CoverageTools
pf = process_folder()
LCOV.writefile("lcov.info", pf)

View File

@@ -1,16 +1,17 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import {wait} from './wait' import * as exec from '@actions/exec'
import * as path from 'path';
async function run(): Promise<void> { async function run(): Promise<void> {
try { try {
const ms: string = core.getInput('milliseconds') if (require.main) {
core.debug(`Waiting ${ms} milliseconds ...`) let rootPath = path.dirname(require.main.filename);
core.debug(new Date().toTimeString()) await exec.exec('julia', ['--color=yes', path.join(rootPath, 'src', 'main.jl')]);
await wait(parseInt(ms, 10)) }
core.debug(new Date().toTimeString()) else {
core.setFailed('Require method to load root path did not work.')
core.setOutput('time', new Date().toTimeString()) }
} catch (error) { } catch (error) {
core.setFailed(error.message) core.setFailed(error.message)
} }

View File

@@ -1,9 +0,0 @@
export async function wait(milliseconds: number): Promise<string> {
return new Promise(resolve => {
if (isNaN(milliseconds)) {
throw new Error('milliseconds not a number')
}
setTimeout(() => resolve('done!'), milliseconds)
})
}