mirror of
https://github.com/yeslayla/run-gut-tests-action.git
synced 2025-02-24 04:25:09 +01:00
Test error checking
This commit is contained in:
parent
02d7c2f145
commit
f5803293ea
16
dist/index.js
vendored
16
dist/index.js
vendored
@ -12179,7 +12179,8 @@ function plural(ms, msAbs, n, name) {
|
|||||||
|
|
||||||
const core = __webpack_require__(470);
|
const core = __webpack_require__(470);
|
||||||
const fs = __webpack_require__(747);
|
const fs = __webpack_require__(747);
|
||||||
const path = __webpack_require__(622)
|
const path = __webpack_require__(622);
|
||||||
|
const stream = __webpack_require__(413);
|
||||||
|
|
||||||
// Setup Docker
|
// Setup Docker
|
||||||
const Docker = __webpack_require__(965);
|
const Docker = __webpack_require__(965);
|
||||||
@ -12196,6 +12197,13 @@ try {
|
|||||||
process.chdir(work_dir);
|
process.chdir(work_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var test_handler = new stream.Writable({
|
||||||
|
write: function(chunk, encoding, next) {
|
||||||
|
console.log("LINE: " + chunk.toString());
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Pull docker image for building
|
// Pull docker image for building
|
||||||
console.log("Pulling build image...");
|
console.log("Pulling build image...");
|
||||||
docker.pull(docker_image, function(err, stream)
|
docker.pull(docker_image, function(err, stream)
|
||||||
@ -12206,16 +12214,14 @@ try {
|
|||||||
// Wait to run build until after pull complete
|
// Wait to run build until after pull complete
|
||||||
function onFinished(err, output)
|
function onFinished(err, output)
|
||||||
{
|
{
|
||||||
console.log("Starting image...")
|
console.log("Starting image...");
|
||||||
docker.run(docker_image, ['godot', '-d', '-s', '--path', '/project', 'addons/gut/gut_cmdln.gd'], process.stdout,
|
docker.run(docker_image, ['godot', '-d', '-s', '--path', '/project', 'addons/gut/gut_cmdln.gd'], test_handler,
|
||||||
|
|
||||||
// Mount working directory to `/project`
|
// Mount working directory to `/project`
|
||||||
{ HostConfig: { Binds: [ process.cwd() + ":/project" ] }},
|
{ HostConfig: { Binds: [ process.cwd() + ":/project" ] }},
|
||||||
|
|
||||||
function (err, data, container) {
|
function (err, data, container) {
|
||||||
|
|
||||||
console.log("DATA: " + String(data[0]))
|
|
||||||
|
|
||||||
if(err)
|
if(err)
|
||||||
{
|
{
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
16
main.js
16
main.js
@ -1,6 +1,7 @@
|
|||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path')
|
const path = require('path');
|
||||||
|
const stream = require('stream');
|
||||||
|
|
||||||
// Setup Docker
|
// Setup Docker
|
||||||
const Docker = require('dockerode');
|
const Docker = require('dockerode');
|
||||||
@ -17,6 +18,13 @@ try {
|
|||||||
process.chdir(work_dir);
|
process.chdir(work_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var test_handler = new stream.Writable({
|
||||||
|
write: function(chunk, encoding, next) {
|
||||||
|
console.log("LINE: " + chunk.toString());
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Pull docker image for building
|
// Pull docker image for building
|
||||||
console.log("Pulling build image...");
|
console.log("Pulling build image...");
|
||||||
docker.pull(docker_image, function(err, stream)
|
docker.pull(docker_image, function(err, stream)
|
||||||
@ -27,16 +35,14 @@ try {
|
|||||||
// Wait to run build until after pull complete
|
// Wait to run build until after pull complete
|
||||||
function onFinished(err, output)
|
function onFinished(err, output)
|
||||||
{
|
{
|
||||||
console.log("Starting image...")
|
console.log("Starting image...");
|
||||||
docker.run(docker_image, ['godot', '-d', '-s', '--path', '/project', 'addons/gut/gut_cmdln.gd'], process.stdout,
|
docker.run(docker_image, ['godot', '-d', '-s', '--path', '/project', 'addons/gut/gut_cmdln.gd'], test_handler,
|
||||||
|
|
||||||
// Mount working directory to `/project`
|
// Mount working directory to `/project`
|
||||||
{ HostConfig: { Binds: [ process.cwd() + ":/project" ] }},
|
{ HostConfig: { Binds: [ process.cwd() + ":/project" ] }},
|
||||||
|
|
||||||
function (err, data, container) {
|
function (err, data, container) {
|
||||||
|
|
||||||
console.log("DATA: " + String(data[0]))
|
|
||||||
|
|
||||||
if(err)
|
if(err)
|
||||||
{
|
{
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user