* 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>
* 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
Cancelled or timeouted workflow would keep the docker container running.
Closesgame-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.
`
* upgrade actions/core to 1.10.0
The current version of actions/core produces a lot of warning about deprecated set-output command, like this:
```
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
```
the new version of actions/core uses the environment files instead, so this version bump should fix the warning
* reran yarn
* 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
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.
Self hosted runners in fedora make the docker.sock a link to /run/podman/podman.sock
Trying to set the :z on docker.sock seems to cause:
```
Error: lsetxattr /var/run/docker.sock: operation not permitted
Error: The process '/usr/bin/docker' failed with exit code 126
```
I think the :z may be broken for links? hard to tell.
* 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
* Refactor to typescript
* Fix platform and workflow
* Fix workflow and platform
* Update husky and image-tag
* Use 'yarn lint-staged' instead of 'npx lint-staged'
* fix unary operator expected error
The if comparisons can sometimes compare an empty variable, which gives errors like this:
```
/steps/run_tests.sh: line 71: [: =: unary operator expected
```
This PR should fix the script to address that problem.
See an explanation of why this error happens here:
https://codefather.tech/blog/bash-unary-operator-expected/
* fix missing quote
* Posix shell compliance
Posix shell does not do ==, it only does one =
* consistent spaces