Init log tracking
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
117
src/act.ts
117
src/act.ts
@@ -2,6 +2,7 @@ import * as child_process from 'child_process';
|
|||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import { commands, CustomExecution, env, EventEmitter, Pseudoterminal, ShellExecution, TaskDefinition, TaskGroup, TaskPanelKind, TaskRevealKind, tasks, TaskScope, TerminalDimensions, window, workspace } from "vscode";
|
import { commands, CustomExecution, env, EventEmitter, Pseudoterminal, ShellExecution, TaskDefinition, TaskGroup, TaskPanelKind, TaskRevealKind, tasks, TaskScope, TerminalDimensions, window, workspace } from "vscode";
|
||||||
import { ComponentsManager } from "./componentsManager";
|
import { ComponentsManager } from "./componentsManager";
|
||||||
|
import { workflowsTreeDataProvider } from './extension';
|
||||||
import { SettingsManager } from './settingsManager';
|
import { SettingsManager } from './settingsManager';
|
||||||
import { Workflow, WorkflowsManager } from "./workflowsManager";
|
import { Workflow, WorkflowsManager } from "./workflowsManager";
|
||||||
|
|
||||||
@@ -42,12 +43,73 @@ export enum EventTrigger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum Option {
|
export enum Option {
|
||||||
Workflows = '-W',
|
Workflows = '--workflows',
|
||||||
Variable = '-var'
|
Variable = '--var',
|
||||||
|
Json = "--json"
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkflowLog {
|
||||||
|
name: string,
|
||||||
|
status: WorkflowStatus
|
||||||
|
jobLogs: JobLog[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface JobLog {
|
||||||
|
name: string,
|
||||||
|
status: JobStatus,
|
||||||
|
stepLogs: StepLog[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StepLog {
|
||||||
|
name: string,
|
||||||
|
status: StepStatus
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RawLog {
|
||||||
|
dryrun: boolean,
|
||||||
|
job: string,
|
||||||
|
jobID: string,
|
||||||
|
level: string, //TODO: Could be an enum?
|
||||||
|
matrix: any,
|
||||||
|
msg: string,
|
||||||
|
time: string,
|
||||||
|
|
||||||
|
stage: string,
|
||||||
|
step: string,
|
||||||
|
stepID: string[],
|
||||||
|
|
||||||
|
jobResult: string, //TODO: Could be an enum?
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum WorkflowStatus {
|
||||||
|
Queued = 'queued',
|
||||||
|
InProgress = 'inProgress',
|
||||||
|
Success = 'success',
|
||||||
|
Failed = 'failed',
|
||||||
|
Cancelled = 'cancelled'
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum JobStatus {
|
||||||
|
Queued = 'queued',
|
||||||
|
InProgress = 'inProgress',
|
||||||
|
Skipped = 'skipped',
|
||||||
|
Success = 'success',
|
||||||
|
Failed = 'failed',
|
||||||
|
Cancelled = 'cancelled'
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum StepStatus {
|
||||||
|
Queued = 'queued',
|
||||||
|
InProgress = 'inProgress',
|
||||||
|
Skipped = 'skipped',
|
||||||
|
Success = 'success',
|
||||||
|
Failed = 'failed',
|
||||||
|
Cancelled = 'cancelled'
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Act {
|
export class Act {
|
||||||
private static base: string = 'act';
|
private static base: string = 'act';
|
||||||
|
workflowLogs: { [path: string]: WorkflowLog[] };
|
||||||
componentsManager: ComponentsManager;
|
componentsManager: ComponentsManager;
|
||||||
workflowsManager: WorkflowsManager;
|
workflowsManager: WorkflowsManager;
|
||||||
settingsManager: SettingsManager;
|
settingsManager: SettingsManager;
|
||||||
@@ -55,6 +117,7 @@ export class Act {
|
|||||||
prebuiltExecutables: { [architecture: string]: string };
|
prebuiltExecutables: { [architecture: string]: string };
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
this.workflowLogs = {};
|
||||||
this.componentsManager = new ComponentsManager();
|
this.componentsManager = new ComponentsManager();
|
||||||
this.workflowsManager = new WorkflowsManager();
|
this.workflowsManager = new WorkflowsManager();
|
||||||
this.settingsManager = new SettingsManager();
|
this.settingsManager = new SettingsManager();
|
||||||
@@ -82,7 +145,7 @@ export class Act {
|
|||||||
'MacPorts': 'sudo port install act',
|
'MacPorts': 'sudo port install act',
|
||||||
'GitHub CLI': 'gh extension install https://github.com/nektos/gh-act'
|
'GitHub CLI': 'gh extension install https://github.com/nektos/gh-act'
|
||||||
};
|
};
|
||||||
|
|
||||||
this.prebuiltExecutables = {
|
this.prebuiltExecutables = {
|
||||||
'macOS 64-bit (Apple Silicon)': 'https://github.com/nektos/act/releases/latest/download/act_Darwin_arm64.tar.gz',
|
'macOS 64-bit (Apple Silicon)': 'https://github.com/nektos/act/releases/latest/download/act_Darwin_arm64.tar.gz',
|
||||||
'macOS 64-bit (Intel)': 'https://github.com/nektos/act/releases/latest/download/act_Darwin_x86_64.tar.gz'
|
'macOS 64-bit (Intel)': 'https://github.com/nektos/act/releases/latest/download/act_Darwin_x86_64.tar.gz'
|
||||||
@@ -96,7 +159,7 @@ export class Act {
|
|||||||
'COPR': 'dnf copr enable goncalossilva/act && dnf install act-cli',
|
'COPR': 'dnf copr enable goncalossilva/act && dnf install act-cli',
|
||||||
'GitHub CLI': 'gh extension install https://github.com/nektos/gh-act'
|
'GitHub CLI': 'gh extension install https://github.com/nektos/gh-act'
|
||||||
};
|
};
|
||||||
|
|
||||||
this.prebuiltExecutables = {
|
this.prebuiltExecutables = {
|
||||||
'Linux 64-bit (arm64/aarch64)': 'https://github.com/nektos/act/releases/latest/download/act_Linux_arm64.tar.gz',
|
'Linux 64-bit (arm64/aarch64)': 'https://github.com/nektos/act/releases/latest/download/act_Linux_arm64.tar.gz',
|
||||||
'Linux 64-bit (amd64/x86_64)': 'https://github.com/nektos/act/releases/latest/download/act_Linux_x86_64.tar.gz',
|
'Linux 64-bit (amd64/x86_64)': 'https://github.com/nektos/act/releases/latest/download/act_Linux_x86_64.tar.gz',
|
||||||
@@ -120,7 +183,7 @@ export class Act {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async runWorkflow(workflow: Workflow) {
|
async runWorkflow(workflow: Workflow) {
|
||||||
return await this.runCommand(workflow, `${Act.base} ${Option.Workflows} ".github/workflows/${path.parse(workflow.uri.fsPath).base}"`);
|
return await this.runCommand(workflow, `${Act.base} ${Option.Json} ${Option.Workflows} ".github/workflows/${path.parse(workflow.uri.fsPath).base}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async runCommand(workflow: Workflow, command: string) {
|
async runCommand(workflow: Workflow, command: string) {
|
||||||
@@ -140,6 +203,29 @@ export class Act {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.workflowLogs[workflow.uri.fsPath]) {
|
||||||
|
this.workflowLogs[workflow.uri.fsPath] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.workflowLogs[workflow.uri.fsPath].push({
|
||||||
|
name: `${workflow.name} #${this.workflowLogs[workflow.uri.fsPath].length + 1}`,
|
||||||
|
status: WorkflowStatus.Queued,
|
||||||
|
jobLogs: Object.entries<any>(workflow.yaml.jobs).map(([key, value]) => {
|
||||||
|
return {
|
||||||
|
name: value.name ? value.name : key,
|
||||||
|
status: JobStatus.Queued,
|
||||||
|
stepLogs: Object.entries<any>(workflow.yaml.jobs[key].steps).map(([key, value]) => {
|
||||||
|
return {
|
||||||
|
name: value.name ? value.name : key,
|
||||||
|
status: StepStatus.Queued,
|
||||||
|
stepLogs: []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
workflowsTreeDataProvider.refresh();
|
||||||
|
|
||||||
await tasks.executeTask({
|
await tasks.executeTask({
|
||||||
name: workflow.name,
|
name: workflow.name,
|
||||||
detail: 'Run workflow',
|
detail: 'Run workflow',
|
||||||
@@ -178,8 +264,25 @@ export class Act {
|
|||||||
|
|
||||||
const exec = child_process.spawn(command, { cwd: workspaceFolder.uri.fsPath, shell: env.shell });
|
const exec = child_process.spawn(command, { cwd: workspaceFolder.uri.fsPath, shell: env.shell });
|
||||||
exec.stdout.on('data', (data) => {
|
exec.stdout.on('data', (data) => {
|
||||||
const output = data.toString().replaceAll('\n', '\r\n');
|
const lines = data.toString().split('\n');
|
||||||
writeEmitter.fire(output);
|
for (const line of lines) {
|
||||||
|
const rawLog: RawLog = JSON.parse(line);
|
||||||
|
|
||||||
|
if (rawLog.stepID) {
|
||||||
|
|
||||||
|
} else if (rawLog.jobID) {
|
||||||
|
// this.workflowLogs[workflow.uri.fsPath][Object.values(this.workflowLogs).length - 1].jobLogs.push({
|
||||||
|
// name: '',
|
||||||
|
// status: '',
|
||||||
|
// stepLogs: []
|
||||||
|
// });
|
||||||
|
} else if (rawLog.jobResult) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
writeEmitter.fire(lines);
|
||||||
});
|
});
|
||||||
|
|
||||||
exec.stderr.on('data', (data) => {
|
exec.stderr.on('data', (data) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
import { commands, env, extensions, QuickPickItemKind, ShellExecution, TaskGroup, TaskPanelKind, TaskRevealKind, tasks, TaskScope, ThemeIcon, Uri, window } from "vscode";
|
import { env, extensions, QuickPickItemKind, ShellExecution, TaskGroup, TaskPanelKind, TaskRevealKind, tasks, TaskScope, ThemeIcon, Uri, window } from "vscode";
|
||||||
import { act } from "./extension";
|
import { act, componentsTreeDataProvider } from "./extension";
|
||||||
|
|
||||||
export interface Component<T extends CliStatus | ExtensionStatus> {
|
export interface Component<T extends CliStatus | ExtensionStatus> {
|
||||||
name: string,
|
name: string,
|
||||||
@@ -102,7 +102,7 @@ export class ComponentsManager {
|
|||||||
await env.openExternal(Uri.parse(selectedPrebuiltExecutable.link));
|
await env.openExternal(Uri.parse(selectedPrebuiltExecutable.link));
|
||||||
window.showInformationMessage('Unpack and run the executable in the terminal specifying the full path or add it to one of the paths in your PATH environment variable. Once nektos/act is successfully installed, refresh the components view.', 'Refresh').then(async value => {
|
window.showInformationMessage('Unpack and run the executable in the terminal specifying the full path or add it to one of the paths in your PATH environment variable. Once nektos/act is successfully installed, refresh the components view.', 'Refresh').then(async value => {
|
||||||
if (value === 'Refresh') {
|
if (value === 'Refresh') {
|
||||||
await commands.executeCommand('githubLocalActions.refreshComponents');
|
componentsTreeDataProvider.refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ export class ComponentsManager {
|
|||||||
await env.openExternal(Uri.parse(selectedInstallationMethod.link));
|
await env.openExternal(Uri.parse(selectedInstallationMethod.link));
|
||||||
window.showInformationMessage('Once nektos/act is successfully installed, refresh the components view.', 'Refresh').then(async value => {
|
window.showInformationMessage('Once nektos/act is successfully installed, refresh the components view.', 'Refresh').then(async value => {
|
||||||
if (value === 'Refresh') {
|
if (value === 'Refresh') {
|
||||||
await commands.executeCommand('githubLocalActions.refreshComponents');
|
componentsTreeDataProvider.refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -170,7 +170,7 @@ export class ComponentsManager {
|
|||||||
|
|
||||||
window.showInformationMessage('Once Docker Engine is successfully started, refresh the components view.', 'Refresh').then(async value => {
|
window.showInformationMessage('Once Docker Engine is successfully started, refresh the components view.', 'Refresh').then(async value => {
|
||||||
if (value === 'Refresh') {
|
if (value === 'Refresh') {
|
||||||
await commands.executeCommand('githubLocalActions.refreshComponents');
|
componentsTreeDataProvider.refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -229,7 +229,7 @@ export class ComponentsManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(checksIfRunning) {
|
if (checksIfRunning) {
|
||||||
resolve({
|
resolve({
|
||||||
version: version ? version[1] : undefined,
|
version: version ? version[1] : undefined,
|
||||||
status: CliStatus.Running
|
status: CliStatus.Running
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import SettingsTreeDataProvider from './views/settings/settingsTreeDataProvider'
|
|||||||
import WorkflowsTreeDataProvider from './views/workflows/workflowsTreeDataProvider';
|
import WorkflowsTreeDataProvider from './views/workflows/workflowsTreeDataProvider';
|
||||||
|
|
||||||
export let act: Act;
|
export let act: Act;
|
||||||
|
export let componentsTreeDataProvider: ComponentsTreeDataProvider;
|
||||||
|
export let workflowsTreeDataProvider: WorkflowsTreeDataProvider;
|
||||||
|
export let settingsTreeDataProvider: SettingsTreeDataProvider;
|
||||||
|
|
||||||
export function activate(context: vscode.ExtensionContext) {
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
console.log('Congratulations, your extension "github-local-actions" is now active!');
|
console.log('Congratulations, your extension "github-local-actions" is now active!');
|
||||||
@@ -14,11 +17,11 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
act = new Act();
|
act = new Act();
|
||||||
|
|
||||||
const decorationProvider = new DecorationProvider();
|
const decorationProvider = new DecorationProvider();
|
||||||
const componentsTreeDataProvider = new ComponentsTreeDataProvider(context);
|
componentsTreeDataProvider = new ComponentsTreeDataProvider(context);
|
||||||
const componentsTreeView = window.createTreeView(ComponentsTreeDataProvider.VIEW_ID, { treeDataProvider: componentsTreeDataProvider });
|
const componentsTreeView = window.createTreeView(ComponentsTreeDataProvider.VIEW_ID, { treeDataProvider: componentsTreeDataProvider });
|
||||||
const workflowsTreeDataProvider = new WorkflowsTreeDataProvider(context);
|
workflowsTreeDataProvider = new WorkflowsTreeDataProvider(context);
|
||||||
const workflowsTreeView = window.createTreeView(WorkflowsTreeDataProvider.VIEW_ID, { treeDataProvider: workflowsTreeDataProvider });
|
const workflowsTreeView = window.createTreeView(WorkflowsTreeDataProvider.VIEW_ID, { treeDataProvider: workflowsTreeDataProvider });
|
||||||
const settingsTreeDataProvider = new SettingsTreeDataProvider(context);
|
settingsTreeDataProvider = new SettingsTreeDataProvider(context);
|
||||||
const settingsTreeView = window.createTreeView(SettingsTreeDataProvider.VIEW_ID, { treeDataProvider: settingsTreeDataProvider });
|
const settingsTreeView = window.createTreeView(SettingsTreeDataProvider.VIEW_ID, { treeDataProvider: settingsTreeDataProvider });
|
||||||
context.subscriptions.push(
|
context.subscriptions.push(
|
||||||
componentsTreeView,
|
componentsTreeView,
|
||||||
|
|||||||
30
src/views/workflows/jobLog.ts
Normal file
30
src/views/workflows/jobLog.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from "vscode";
|
||||||
|
import { JobLog } from "../../act";
|
||||||
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
|
import StepTreeItem from "./stepLog";
|
||||||
|
|
||||||
|
export default class JobLogTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
|
static contextValue = 'githubLocalActions.jobLog';
|
||||||
|
jobLog: JobLog;
|
||||||
|
|
||||||
|
constructor(jobLog: JobLog) {
|
||||||
|
super(jobLog.name, TreeItemCollapsibleState.Collapsed);
|
||||||
|
this.jobLog = jobLog;
|
||||||
|
this.contextValue = JobLogTreeItem.contextValue;
|
||||||
|
this.iconPath = new ThemeIcon('pass-filled');
|
||||||
|
// this.tooltip = `Name: ${workflow.name}\n` +
|
||||||
|
// `Path: ${workflow.uri.fsPath}\n` +
|
||||||
|
// (workflow.error ? `Error: ${workflow.error}` : ``);
|
||||||
|
|
||||||
|
// TODO: Add tooltip and resourceUri
|
||||||
|
}
|
||||||
|
|
||||||
|
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
|
||||||
|
const stepLogs = this.jobLog.stepLogs;
|
||||||
|
if (stepLogs) {
|
||||||
|
return this.jobLog.stepLogs.map(step => new StepTreeItem(step));
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
src/views/workflows/stepLog.ts
Normal file
24
src/views/workflows/stepLog.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from "vscode";
|
||||||
|
import { StepLog } from "../../act";
|
||||||
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
|
|
||||||
|
export default class StepLogTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
|
static contextValue = 'githubLocalActions.stepLog';
|
||||||
|
stepLog: StepLog;
|
||||||
|
|
||||||
|
constructor(stepLog: StepLog) {
|
||||||
|
super(stepLog.name, TreeItemCollapsibleState.None);
|
||||||
|
this.stepLog = stepLog;
|
||||||
|
this.contextValue = StepLogTreeItem.contextValue;
|
||||||
|
this.iconPath = new ThemeIcon('pass-filled');
|
||||||
|
// this.tooltip = `Name: ${workflow.name}\n` +
|
||||||
|
// `Path: ${workflow.uri.fsPath}\n` +
|
||||||
|
// (workflow.error ? `Error: ${workflow.error}` : ``);
|
||||||
|
|
||||||
|
// TODO: Add tooltip and resourceUri
|
||||||
|
}
|
||||||
|
|
||||||
|
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
|
||||||
|
import { act } from "../../extension";
|
||||||
import { Workflow } from "../../workflowsManager";
|
import { Workflow } from "../../workflowsManager";
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
|
import WorkflowLogTreeItem from "./workflowLog";
|
||||||
|
|
||||||
export default class WorkflowTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
export default class WorkflowTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
static contextValue = 'githubLocalActions.workflow';
|
static contextValue = 'githubLocalActions.workflow';
|
||||||
@@ -15,12 +17,17 @@ export default class WorkflowTreeItem extends TreeItem implements GithubLocalAct
|
|||||||
`Path: ${workflow.uri.fsPath}\n` +
|
`Path: ${workflow.uri.fsPath}\n` +
|
||||||
(workflow.error ? `Error: ${workflow.error}` : ``);
|
(workflow.error ? `Error: ${workflow.error}` : ``);
|
||||||
|
|
||||||
if(workflow.error) {
|
if (workflow.error) {
|
||||||
this.resourceUri = Uri.parse(`${WorkflowTreeItem.contextValue}:${workflow.name}?error=${workflow.error}`, true);
|
this.resourceUri = Uri.parse(`${WorkflowTreeItem.contextValue}:${workflow.name}?error=${workflow.error}`, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
|
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
|
||||||
return [];
|
const workflowLogs = act.workflowLogs[this.workflow.uri.fsPath];
|
||||||
|
if (workflowLogs) {
|
||||||
|
return workflowLogs.map(workflowLog => new WorkflowLogTreeItem(workflowLog));
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
25
src/views/workflows/workflowLog.ts
Normal file
25
src/views/workflows/workflowLog.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from "vscode";
|
||||||
|
import { WorkflowLog } from "../../act";
|
||||||
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
|
import JobLogTreeItem from "./jobLog";
|
||||||
|
|
||||||
|
export default class WorkflowLogTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
|
static contextValue = 'githubLocalActions.workflowLog';
|
||||||
|
workflowLog: WorkflowLog;
|
||||||
|
|
||||||
|
constructor(workflowLog: WorkflowLog) {
|
||||||
|
super(workflowLog.name, TreeItemCollapsibleState.Collapsed);
|
||||||
|
this.workflowLog = workflowLog;
|
||||||
|
this.contextValue = WorkflowLogTreeItem.contextValue;
|
||||||
|
this.iconPath = new ThemeIcon('pass-filled');
|
||||||
|
// this.tooltip = `Name: ${workflow.name}\n` +
|
||||||
|
// `Path: ${workflow.uri.fsPath}\n` +
|
||||||
|
// (workflow.error ? `Error: ${workflow.error}` : ``);
|
||||||
|
|
||||||
|
// TODO: Add tooltip and resourceUri
|
||||||
|
}
|
||||||
|
|
||||||
|
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
|
||||||
|
return this.workflowLog.jobLogs.map(jobLog => new JobLogTreeItem(jobLog));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,44 +11,7 @@ export interface Workflow {
|
|||||||
error?: string
|
error?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WorkflowLog {
|
|
||||||
workflow: Workflow,
|
|
||||||
status: WorkflowStatus
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum WorkflowStatus {
|
|
||||||
Queued = 'queued',
|
|
||||||
InProgress = 'inProgress',
|
|
||||||
success = 'success',
|
|
||||||
failed = 'failed',
|
|
||||||
Cancelled = 'cancelled'
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum JobStatus {
|
|
||||||
Queued = 'queued',
|
|
||||||
InProgress = 'inProgress',
|
|
||||||
Skipped = 'skipped',
|
|
||||||
success = 'success',
|
|
||||||
failed = 'failed',
|
|
||||||
Cancelled = 'cancelled'
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum StepStatus {
|
|
||||||
Queued = 'queued',
|
|
||||||
InProgress = 'inProgress',
|
|
||||||
Skipped = 'skipped',
|
|
||||||
success = 'success',
|
|
||||||
failed = 'failed',
|
|
||||||
Cancelled = 'cancelled'
|
|
||||||
}
|
|
||||||
|
|
||||||
export class WorkflowsManager {
|
export class WorkflowsManager {
|
||||||
private workflowLogs: WorkflowLog[] = [];
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
async getWorkflows(): Promise<Workflow[]> {
|
async getWorkflows(): Promise<Workflow[]> {
|
||||||
const workflows: Workflow[] = [];
|
const workflows: Workflow[] = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user