delete unused code
parent
27cb8492fa
commit
faa6753eac
|
@ -1,17 +0,0 @@
|
||||||
ARG IMAGE
|
|
||||||
FROM $IMAGE
|
|
||||||
|
|
||||||
LABEL "com.github.actions.name"="Unity - Test runner"
|
|
||||||
LABEL "com.github.actions.description"="Run tests for any Unity project."
|
|
||||||
LABEL "com.github.actions.icon"="box"
|
|
||||||
LABEL "com.github.actions.color"="gray-dark"
|
|
||||||
|
|
||||||
LABEL "repository"="http://github.com/webbertakken/unity-actions"
|
|
||||||
LABEL "homepage"="http://github.com/webbertakken/unity-actions"
|
|
||||||
LABEL "maintainer"="Webber Takken <webber@takken.io>"
|
|
||||||
|
|
||||||
ADD steps /steps
|
|
||||||
RUN chmod -R +x /steps
|
|
||||||
ADD entrypoint.sh /entrypoint.sh
|
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
@ -41,13 +41,12 @@ function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
model_1.Action.checkCompatibility();
|
model_1.Action.checkCompatibility();
|
||||||
const { dockerfile, workspace, actionFolder } = model_1.Action;
|
const { workspace, actionFolder } = model_1.Action;
|
||||||
const { unityVersion, customImage, projectPath, customParameters, testMode, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, checkName, } = model_1.Input.getFromUser();
|
const { unityVersion, customImage, projectPath, customParameters, testMode, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, checkName, } = model_1.Input.getFromUser();
|
||||||
const baseImage = new model_1.ImageTag({ version: unityVersion, customImage });
|
const baseImage = new model_1.ImageTag({ version: unityVersion, customImage });
|
||||||
const runnerTempPath = process.env.RUNNER_TEMP;
|
const runnerTempPath = process.env.RUNNER_TEMP;
|
||||||
try {
|
try {
|
||||||
// Build docker image
|
// Build docker image
|
||||||
//const actionImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
|
|
||||||
// Run docker image
|
// Run docker image
|
||||||
yield model_1.Docker.run(baseImage, {
|
yield model_1.Docker.run(baseImage, {
|
||||||
actionFolder,
|
actionFolder,
|
||||||
|
@ -117,9 +116,6 @@ const Action = {
|
||||||
get actionFolder() {
|
get actionFolder() {
|
||||||
return `${Action.rootFolder}/dist`;
|
return `${Action.rootFolder}/dist`;
|
||||||
},
|
},
|
||||||
get dockerfile() {
|
|
||||||
return `${Action.actionFolder}/Dockerfile`;
|
|
||||||
},
|
|
||||||
get workspace() {
|
get workspace() {
|
||||||
return process.env.GITHUB_WORKSPACE;
|
return process.env.GITHUB_WORKSPACE;
|
||||||
},
|
},
|
||||||
|
@ -154,23 +150,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const fs_1 = __nccwpck_require__(7147);
|
const fs_1 = __nccwpck_require__(7147);
|
||||||
const image_tag_1 = __importDefault(__nccwpck_require__(7648));
|
|
||||||
const exec_1 = __nccwpck_require__(1514);
|
const exec_1 = __nccwpck_require__(1514);
|
||||||
const path_1 = __importDefault(__nccwpck_require__(1017));
|
const path_1 = __importDefault(__nccwpck_require__(1017));
|
||||||
const Docker = {
|
const Docker = {
|
||||||
build(buildParameters, silent = false) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const { path: buildPath, dockerfile, baseImage } = buildParameters;
|
|
||||||
const { version } = baseImage;
|
|
||||||
const tag = new image_tag_1.default({ version });
|
|
||||||
const command = `docker build ${buildPath} \
|
|
||||||
--file ${dockerfile} \
|
|
||||||
--build-arg IMAGE=${baseImage} \
|
|
||||||
--tag ${tag}`;
|
|
||||||
yield (0, exec_1.exec)(command, undefined, { silent });
|
|
||||||
return tag;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
run(image, parameters, silent = false) {
|
run(image, parameters, silent = false) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const { actionFolder, unityVersion, workspace, projectPath, customParameters, testMode, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTempPath, } = parameters;
|
const { actionFolder, unityVersion, workspace, projectPath, customParameters, testMode, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTempPath, } = parameters;
|
||||||
|
@ -220,8 +202,7 @@ const Docker = {
|
||||||
${useHostNetwork ? '--net=host' : ''} \
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||||
${image} \
|
${image} \
|
||||||
-- \
|
/bin/bash /entrypoint.sh`;
|
||||||
/usr/bin/bash /entrypoint.sh`;
|
|
||||||
yield (0, exec_1.exec)(command, undefined, { silent });
|
yield (0, exec_1.exec)(command, undefined, { silent });
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,7 @@ async function run() {
|
||||||
try {
|
try {
|
||||||
Action.checkCompatibility();
|
Action.checkCompatibility();
|
||||||
|
|
||||||
const { dockerfile, workspace, actionFolder } = Action;
|
const { workspace, actionFolder } = Action;
|
||||||
const {
|
const {
|
||||||
unityVersion,
|
unityVersion,
|
||||||
customImage,
|
customImage,
|
||||||
|
@ -24,7 +24,6 @@ async function run() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Build docker image
|
// Build docker image
|
||||||
//const actionImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
|
|
||||||
|
|
||||||
// Run docker image
|
// Run docker image
|
||||||
await Docker.run(baseImage, {
|
await Docker.run(baseImage, {
|
||||||
|
|
|
@ -29,10 +29,6 @@ const Action = {
|
||||||
return `${Action.rootFolder}/dist`;
|
return `${Action.rootFolder}/dist`;
|
||||||
},
|
},
|
||||||
|
|
||||||
get dockerfile() {
|
|
||||||
return `${Action.actionFolder}/Dockerfile`;
|
|
||||||
},
|
|
||||||
|
|
||||||
get workspace() {
|
get workspace() {
|
||||||
return process.env.GITHUB_WORKSPACE;
|
return process.env.GITHUB_WORKSPACE;
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,21 +1,7 @@
|
||||||
import Action from './action';
|
import Action from './action';
|
||||||
import Docker from './docker';
|
import Docker from './docker';
|
||||||
import ImageTag from './image-tag';
|
|
||||||
|
|
||||||
describe('Docker', () => {
|
describe('Docker', () => {
|
||||||
it.skip('builds', async () => {
|
|
||||||
const path = Action.actionFolder;
|
|
||||||
const dockerfile = `${path}/Dockerfile`;
|
|
||||||
const baseImage = new ImageTag({
|
|
||||||
repository: '',
|
|
||||||
name: 'alpine',
|
|
||||||
version: '3',
|
|
||||||
platform: 'Test',
|
|
||||||
});
|
|
||||||
const tag = await Docker.build({ path, dockerfile, baseImage }, true);
|
|
||||||
expect(tag).toBeInstanceOf(ImageTag);
|
|
||||||
expect(tag.toString()).toStrictEqual('unity-builder:3');
|
|
||||||
}, 240_000);
|
|
||||||
it.skip('runs', async () => {
|
it.skip('runs', async () => {
|
||||||
const image = 'unity-builder:2019.2.11f1-webgl';
|
const image = 'unity-builder:2019.2.11f1-webgl';
|
||||||
const parameters = {
|
const parameters = {
|
||||||
|
|
|
@ -1,24 +1,8 @@
|
||||||
import { existsSync, mkdirSync } from 'fs';
|
import { existsSync, mkdirSync } from 'fs';
|
||||||
import ImageTag from './image-tag';
|
|
||||||
import { exec } from '@actions/exec';
|
import { exec } from '@actions/exec';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const Docker = {
|
const Docker = {
|
||||||
async build(buildParameters, silent = false) {
|
|
||||||
const { path: buildPath, dockerfile, baseImage } = buildParameters;
|
|
||||||
const { version } = baseImage;
|
|
||||||
|
|
||||||
const tag = new ImageTag({ version });
|
|
||||||
const command = `docker build ${buildPath} \
|
|
||||||
--file ${dockerfile} \
|
|
||||||
--build-arg IMAGE=${baseImage} \
|
|
||||||
--tag ${tag}`;
|
|
||||||
|
|
||||||
await exec(command, undefined, { silent });
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
},
|
|
||||||
|
|
||||||
async run(image, parameters, silent = false) {
|
async run(image, parameters, silent = false) {
|
||||||
const {
|
const {
|
||||||
actionFolder,
|
actionFolder,
|
||||||
|
@ -80,7 +64,7 @@ const Docker = {
|
||||||
${useHostNetwork ? '--net=host' : ''} \
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||||
${image} \
|
${image} \
|
||||||
/bin/bash /entrypoint.sh` ;
|
/bin/bash /entrypoint.sh`;
|
||||||
|
|
||||||
await exec(command, undefined, { silent });
|
await exec(command, undefined, { silent });
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue