render-ci-matrix
Advanced tools
+47
-45
| const render = require('.')() | ||
| process.stdout.write(render({ | ||
| repo: ['juliangruber', 'render-ci-results'], | ||
| build: { | ||
| id: 13, | ||
| number: 42 | ||
| }, | ||
| commit: { | ||
| id: '123456', | ||
| branch: 'master' | ||
| }, | ||
| success: true, | ||
| link: 'https://travis-ci.org/juliangruber/render-ci-results/builds/13', | ||
| results: { | ||
| osx: { | ||
| foo: { | ||
| version: '6', | ||
| config: { | ||
| language: 'node_js', | ||
| env: 'FOO=bar' | ||
| process.stdout.write( | ||
| render({ | ||
| repo: ['juliangruber', 'render-ci-results'], | ||
| build: { | ||
| id: 13, | ||
| number: 42 | ||
| }, | ||
| commit: { | ||
| id: '123456', | ||
| branch: 'master' | ||
| }, | ||
| success: true, | ||
| link: 'https://travis-ci.org/juliangruber/render-ci-results/builds/13', | ||
| results: { | ||
| osx: { | ||
| foo: { | ||
| version: '6', | ||
| config: { | ||
| language: 'node_js', | ||
| env: 'FOO=bar' | ||
| }, | ||
| started_at: Date.now() - 1000, | ||
| state: 'started' | ||
| }, | ||
| started_at: Date.now() - 1000, | ||
| state: 'started' | ||
| }, | ||
| bar: { | ||
| version: '1.0', | ||
| config: { | ||
| language: 'ruby' | ||
| bar: { | ||
| version: '1.0', | ||
| config: { | ||
| language: 'ruby' | ||
| }, | ||
| state: 'queued' | ||
| }, | ||
| state: 'queued' | ||
| beep: { | ||
| version: '5.2', | ||
| config: { | ||
| language: 'php' | ||
| }, | ||
| started_at: Date.now() - 10000, | ||
| state: 'started' | ||
| } | ||
| }, | ||
| beep: { | ||
| version: '5.2', | ||
| config: { | ||
| language: 'php' | ||
| }, | ||
| started_at: Date.now() - 10000, | ||
| state: 'started' | ||
| linux: { | ||
| boop: { | ||
| version: '1.0', | ||
| config: { | ||
| language: 'golang' | ||
| }, | ||
| state: 'queued' | ||
| } | ||
| } | ||
| }, | ||
| linux: { | ||
| boop: { | ||
| version: '1.0', | ||
| config: { | ||
| language: 'golang' | ||
| }, | ||
| state: 'queued' | ||
| } | ||
| } | ||
| } | ||
| })) | ||
| }) | ||
| ) |
+17
-9
@@ -18,3 +18,11 @@ 'use strict' | ||
| if (!state.build) return `${chalk.gray(frame)} Loading build` | ||
| if (!state.build) { | ||
| out += `${chalk.gray(frame)} Loading build` | ||
| if (state.started && new Date() - state.started > ms('10s')) { | ||
| out += chalk.yellow( | ||
| `\nIt is taking unusually long to fetch your build.\nHave you pushed your commits yet?` | ||
| ) | ||
| } | ||
| return out | ||
| } | ||
@@ -25,5 +33,3 @@ if (!state.commit.id) return `${chalk.gray(frame)} Looking for commit` | ||
| if (typeof state.success === 'boolean') { | ||
| header = state.success | ||
| ? chalk.green(header) | ||
| : chalk.red(header) | ||
| header = state.success ? chalk.green(header) : chalk.red(header) | ||
| } | ||
@@ -35,3 +41,5 @@ | ||
| if (!Object.keys(state.results).length) return out + ` ${chalk.gray(frame)} Loading jobs` | ||
| if (!Object.keys(state.results).length) { | ||
| return out + ` ${chalk.gray(frame)} Loading jobs` | ||
| } | ||
@@ -61,7 +69,7 @@ Object.keys(state.results).forEach((os, i, arr) => { | ||
| : job.state === 'failed' && job.allow_failure | ||
| ? chalk.gray('×') | ||
| : job.state === 'passed' | ||
| ? chalk.green('✓') | ||
| : job.state === 'started' ? chalk.yellow(frame) : chalk.gray(frame) | ||
| ? chalk.gray('×') | ||
| : job.state === 'passed' | ||
| ? chalk.green('✓') | ||
| : job.state === 'started' ? chalk.yellow(frame) : chalk.gray(frame) | ||
| return out | ||
| } |
+1
-1
| { | ||
| "name": "render-ci-matrix", | ||
| "version": "1.0.2", | ||
| "version": "1.1.0", | ||
| "license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "juliangruber/render-ci-matrix", |
+1
-0
@@ -21,2 +21,3 @@ | ||
| }, | ||
| started: Date.now(), | ||
| commit: { | ||
@@ -23,0 +24,0 @@ id: '123456', |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
5245
7.9%109
10.1%82
1.23%1
Infinity%