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:
1675
dist/index.js
vendored
1675
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 * 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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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