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* () {
|
||||
try {
|
||||
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 baseImage = new model_1.ImageTag({ version: unityVersion, customImage });
|
||||
const runnerTempPath = process.env.RUNNER_TEMP;
|
||||
try {
|
||||
// Build docker image
|
||||
//const actionImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
|
||||
// Run docker image
|
||||
yield model_1.Docker.run(baseImage, {
|
||||
actionFolder,
|
||||
|
@ -117,9 +116,6 @@ const Action = {
|
|||
get actionFolder() {
|
||||
return `${Action.rootFolder}/dist`;
|
||||
},
|
||||
get dockerfile() {
|
||||
return `${Action.actionFolder}/Dockerfile`;
|
||||
},
|
||||
get workspace() {
|
||||
return process.env.GITHUB_WORKSPACE;
|
||||
},
|
||||
|
@ -154,23 +150,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const fs_1 = __nccwpck_require__(7147);
|
||||
const image_tag_1 = __importDefault(__nccwpck_require__(7648));
|
||||
const exec_1 = __nccwpck_require__(1514);
|
||||
const path_1 = __importDefault(__nccwpck_require__(1017));
|
||||
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) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const { actionFolder, unityVersion, workspace, projectPath, customParameters, testMode, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTempPath, } = parameters;
|
||||
|
@ -220,8 +202,7 @@ const Docker = {
|
|||
${useHostNetwork ? '--net=host' : ''} \
|
||||
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||
${image} \
|
||||
-- \
|
||||
/usr/bin/bash /entrypoint.sh`;
|
||||
/bin/bash /entrypoint.sh`;
|
||||
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 {
|
||||
Action.checkCompatibility();
|
||||
|
||||
const { dockerfile, workspace, actionFolder } = Action;
|
||||
const { workspace, actionFolder } = Action;
|
||||
const {
|
||||
unityVersion,
|
||||
customImage,
|
||||
|
@ -24,7 +24,6 @@ async function run() {
|
|||
|
||||
try {
|
||||
// Build docker image
|
||||
//const actionImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
|
||||
|
||||
// Run docker image
|
||||
await Docker.run(baseImage, {
|
||||
|
|
|
@ -29,10 +29,6 @@ const Action = {
|
|||
return `${Action.rootFolder}/dist`;
|
||||
},
|
||||
|
||||
get dockerfile() {
|
||||
return `${Action.actionFolder}/Dockerfile`;
|
||||
},
|
||||
|
||||
get workspace() {
|
||||
return process.env.GITHUB_WORKSPACE;
|
||||
},
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
import Action from './action';
|
||||
import Docker from './docker';
|
||||
import ImageTag from './image-tag';
|
||||
|
||||
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 () => {
|
||||
const image = 'unity-builder:2019.2.11f1-webgl';
|
||||
const parameters = {
|
||||
|
|
|
@ -1,24 +1,8 @@
|
|||
import { existsSync, mkdirSync } from 'fs';
|
||||
import ImageTag from './image-tag';
|
||||
import { exec } from '@actions/exec';
|
||||
import path from 'path';
|
||||
|
||||
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) {
|
||||
const {
|
||||
actionFolder,
|
||||
|
|
Loading…
Reference in New Issue