Commit Graph

74 Commits (0df3ab6b88fe7f787c692d1b3f3f857636e166be)

Author SHA1 Message Date
Aaron Trudeau 0df3ab6b88
fix documentation and add error message for missing jq 2023-06-07 01:23:53 -04:00
Aaron Trudeau 1afbd6b347
fix fs mocks and run yarn build 2023-05-24 00:13:31 -04:00
Aaron Trudeau ffb0014506
Merge in changes 2023-05-23 20:29:00 -04:00
Tim Cassell 31086d9859
Add standalone testmode support (#219)
* Add standalone support.

* Add standalone tests.

* UnityStandaloneScripts volume on windows

* Update test framework in test project.

* Revert IL2CPP setting in test project.
Add test for IL2CPP.

* Update dist/test-standalone-scripts/Assets/Player/UnityTestRunnerAction/TestRunCallback.cs

Co-authored-by: Webber Takken <webber.nl@gmail.com>

* Use 2019.2.21f1

* Unity is being dumb, use 2019.4.40f1 for all workflows.

* Disable PlayerConnection on build.
Print player log.

* Add comment about code coverage support in standalone.

* Update node-version in test

---------

Co-authored-by: Webber Takken <webber.nl@gmail.com>
2023-04-20 22:23:15 -05:00
David Finol d982116b88
Run linting (#207) 2022-12-24 23:45:38 +01:00
simensan 9fe2feb3c9
Feature/add support for licensing server (#196)
* First take on adding support for sending in unity licensing server url on linux

* Forgot to build dist

* Moved services-config parsing to typescript

* Need to set licensing server env variable for activate.sh

* Forgot unused docker mount directory /resources
2022-11-04 12:35:06 +01:00
Webber Takken 68d1df1d1b
fix: broken lints (#199)
* fix: broken lints

* fix broken CI
2022-11-03 18:27:46 -05:00
Michal Cichra 698c08cf4e
feat: ensure cleanup of docker containers (#198)
Cancelled or timeouted workflow would keep the docker container running.
Closes game-ci/unity-test-runner#197

This has two parts:

Part one. The entrypoints.

`runs.post`: GitHub Action metadata allow running something after the
action (regardless of a failure, crash, timeout, ...).
https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost

However, it needs to be a `.js` file and it can't be configured to pass
any arguments.

There already was `index.js` used as the main entrypoint.
The build process of this file uses typescript compiler and ncc to pack
all dependencies into one .js file. And ncc has no way of generating
multiple files in one go, so the only solution would be to run ncc twice
and generate two independent files.

That would be quite unfortunate, wasting time and storage. So I rather
came up with a new entrypoint that symlinked from two locations.
And this new entrypoint understands how it was executed, so it can run
the correct behaviour. This makes it easy to add `runs.pre` if needed.

This new entrypoint is in `index.ts`. The original `index.ts` is now in
`main.ts`.

Part two.
The signals. I've tried:
* try/catch/finally around the `await Docker.run`. Catch and finally are
  not executed when process receives SIGINT. See the discussion in: https://github.com/nodejs/node/discussions/29480
* New AbortController and AbortSignal. Great concept, but the
  action.exec does not support it. So it can't be aborted.
* Doing cleanup on `process.on('exit')`. Unfortunately you can't really
  do async stuff from there, so can't really run the docker rm command
to delete the container.
* Using `process.on('SIGINT')`. For some reason that wasn't really
  executing for me. I'd not put my hand in fire for this, but I assume
because it was in the signal handler it does something special, or would
heed to be scheduled for later with `setTimeout(0)`.

Evaluating all these I came to a conclusion that it is fragile and just
relying on a `runs.post` is much better and safer.
`
2022-11-03 19:14:51 +01:00
Paul Pacheco 5263cf0ab1
rebuild to take into account new @action/core (#195)
After upgrading actions core, I apprently forgot to rebuild the
dist folder,  so it didn't take the change.
2022-10-16 22:15:42 +02:00
Aaron Trudeau 402522369e
log permissions for package folder 2022-06-30 21:33:56 -04:00
Aaron Trudeau f75f0ebbd1
scrap file removals and print dir permissions 2022-06-30 21:15:19 -04:00
Aaron Trudeau c9301a22f2
fix license activation files deletion 2022-06-30 21:01:28 -04:00
Aaron Trudeau 9169a99f4e
try deleting all non-package files 2022-06-30 20:48:58 -04:00
Aaron Trudeau 1f56db93bb
try logging hidden package files 2022-06-30 20:37:25 -04:00
Aaron Trudeau 6d87a92844
try deleting activate license file 2022-06-30 20:20:26 -04:00
Aaron Trudeau dbb5a4cdbd
move package mode check lower in the file 2022-06-30 14:46:31 -04:00
Aaron Trudeau 8bed00016b
run yarn build 2022-06-30 14:09:48 -04:00
Aaron Trudeau 0061df2fca
merge main 2022-06-30 14:09:25 -04:00
Skjalg S. Mæhre 3d5d2f5834
Add chownFilesTo (#187)
* add chownFilesTo

* added missing newline

* added more chownFilesTo
2022-06-24 12:59:01 +02:00
Matthew Shiroma e8774f3837
Added Windows Support (#184)
* Modifying js files to account for win support

* Added new powershell scripts to support windows invocation

* Fixed undefined error in stack trace logic

* Added new func for resolving image tag default

* Changed structure of docker.js to match new standard
2022-05-24 01:41:36 +02:00
Aaron Trudeau 76e4fa8414
Revert "add logic to copy package to folder without activation file"
This reverts commit b20d994b5d.
2022-05-11 00:06:45 -04:00
Aaron Trudeau 0e7c6f93e2
Revert "fix false positive activation file detection"
This reverts commit 580c9c14a0.
2022-05-11 00:06:38 -04:00
Aaron Trudeau 4895ba9da2
Revert "fix improper bash "if" formatting"
This reverts commit acb975bcea.
2022-05-11 00:06:33 -04:00
Aaron Trudeau 397d1bad5f
Revert "TEMP remove conditional for package copying"
This reverts commit 4f12d83889.
2022-05-11 00:06:28 -04:00
Aaron Trudeau 4f12d83889
TEMP remove conditional for package copying 2022-05-11 00:00:54 -04:00
Aaron Trudeau acb975bcea
fix improper bash "if" formatting 2022-05-10 23:56:20 -04:00
Aaron Trudeau 580c9c14a0
fix false positive activation file detection 2022-05-10 23:49:47 -04:00
Aaron Trudeau b20d994b5d
add logic to copy package to folder without activation file 2022-05-10 23:47:07 -04:00
Aaron Trudeau 139a8b1b78
Revert "TEMP console log project folder"
This reverts commit 411ec51817.
2022-05-10 23:46:31 -04:00
Aaron Trudeau 411ec51817
TEMP console log project folder 2022-05-10 22:53:52 -04:00
Aaron Trudeau c927250c22
remove temp project manifest log 2022-04-26 13:35:16 -04:00
Aaron Trudeau 1580d4cb48
add code coverage package to generated project 2022-04-26 13:21:43 -04:00
Aaron Trudeau c942fae210
TEMP log project's manifest 2022-04-26 12:55:11 -04:00
Aaron Trudeau d8ac8df79d
Revert "TEMP list installed packages"
This reverts commit db9c07da38.
2022-04-26 12:28:22 -04:00
Aaron Trudeau 793451abba
Merge remote-tracking branch 'upstream/main' 2022-04-26 11:55:45 -04:00
Nick Maltbie 96562463cf
Code Coverage Support (#182)
* Added basic framework for enable code coverage

* Added basic coverage results building and combination

* fixed ENABLE_CODE_COVERAGE to be `true` or `false`

* Added code coverage project to manifest

* Updated to add more tests for code coverage build

* Updated coverage parameter documentation

* Fixed small syntax error

* Enabled code coverage flag for code coverage tests

* Fixed error in test file build

* Updated project run settings

* Fixed error when creating combined code coverage results

* Updated testing workflows

* updated test workflows

* Updated parameters and added tests

* Updated tests and bash script for running

* Updated run_tests.sh script to simplfy some parameters

* Updated run_tests to remove incorrect ';'

* Updated run_tests script

* Fixed small syntax error

* Fixed for loop in run_tests.sh

* Updated run_tests syntax error for '=' operator

* Fixed runTests variable assignment

* Fixed parameters for running tests via bash

* Corrected bash arguments

* Updated test cases in main.yml

* Updated parameter names and default values for code coverage

* Fixed broken paths for coverage results upload in main.yml

* Corrected names of coverage results artifacts
2022-04-21 10:50:37 +02:00
Webber Takken 67402dce6f
feat: upgrade to images of version 1 (rolling tag) (#179)
* feat: upgrade to images of version 1 (rolling tag)

* fix: broken husky hook
2022-04-03 17:59:11 +02:00
Paul Pacheco 50a3bd4138
perf: avoid creating temporary docker image (#177)
* avoid building custom image

* Rebuild

* fix wrong folder for entrypoint.sh

* run with bash

* fix path to bash

* Mount with permissions

* Rebuild

* add missing continuation

* rebuild

* Fix docker invocation

* delete unused code

* Fix test

* remove old comment

* Fix code styles

Co-authored-by: Webber Takken <webber.nl@gmail.com>
2022-04-03 12:14:39 +02:00
Aaron Trudeau db9c07da38
TEMP list installed packages 2022-03-30 21:04:08 -04:00
Aaron Trudeau 14f2743fbd
Revert "Revert "remove jq install""
This reverts commit e3bac048b1.
2022-03-30 20:26:14 -04:00
Aaron Trudeau 2fe4078c8d
Revert "TEMP log image in use"
This reverts commit 95722dcab4.
2022-03-30 19:55:22 -04:00
Aaron Trudeau 95722dcab4
TEMP log image in use 2022-03-30 19:54:37 -04:00
Aaron Trudeau e3bac048b1
Revert "remove jq install"
This reverts commit bd35ac8f6f.
2022-03-30 19:40:38 -04:00
Aaron Trudeau bd35ac8f6f
remove jq install 2022-03-29 23:08:49 -04:00
Paul Pacheco f87ed30c30
feat: work with rootless docker (#175)
Running docker currently mounts the docker.sock file into the container.
This was introduced in d6c937fe37 but
there is no explanation provided.

The docker.sock file is only needed if we want to run docker inside the container
to create other images or start other containers.
I searched through the code and I did not find any such use.

In particular, on fedora this gives permission denied because docker.sock
is owned by root and the container runs under an unprivileged user.
One has to change the permissions of docker.sock
(which is actually a link to /run/podman/podman.sock) to be writeable by the user.

If we don't need to use docker inside the containers,  then we can remove this file,
thus we can run this GitHub action as an unprivileged user out of the box.
2022-03-27 03:03:16 +02:00
Aaron Trudeau 7338fb9975
merge main and fix no-abbreviation eslint error 2022-03-25 14:00:00 -04:00
Paul Pacheco 8324e03548
Rebuild after docker.sock:z fix (#173) 2022-03-23 19:42:20 +01:00
Paul Pacheco 79715c7e78
feat: support self-hosted runners (#170)
* feat: support self-hosted runners

similar to https://github.com/game-ci/unity-builder/pull/355

* Use $RUNNER_TEMP variable instead of hardcoded path for _github_home and _github_workflow
* create the folders if they don't exist
* mount volumes with :z for compatibility with SELinux

* compile typescript files
2022-03-11 18:46:28 +01:00
Aaron Trudeau 441ad80ded
add error for missing tests folder 2022-03-01 01:19:09 -05:00
Aaron Trudeau 7f6ed5d052
improve logging for temp project creation failure 2022-02-28 22:47:29 -05:00