mirror of
https://github.com/julia-actions/julia-processcoverage.git
synced 2026-02-12 02:56:59 +08:00
Update code
This commit is contained in:
1303
dist/index.js
vendored
1303
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
11
src/main.jl
Normal file
11
src/main.jl
Normal 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)
|
||||
17
src/main.ts
17
src/main.ts
@@ -1,16 +1,17 @@
|
||||
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> {
|
||||
try {
|
||||
const ms: string = core.getInput('milliseconds')
|
||||
core.debug(`Waiting ${ms} milliseconds ...`)
|
||||
if (require.main) {
|
||||
let rootPath = path.dirname(require.main.filename);
|
||||
|
||||
core.debug(new Date().toTimeString())
|
||||
await wait(parseInt(ms, 10))
|
||||
core.debug(new Date().toTimeString())
|
||||
|
||||
core.setOutput('time', new Date().toTimeString())
|
||||
await exec.exec('julia', ['--color=yes', path.join(rootPath, 'src', 'main.jl')]);
|
||||
}
|
||||
else {
|
||||
core.setFailed('Require method to load root path did not work.')
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed(error.message)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user