Commit Graph

208 Commits (main)

Author SHA1 Message Date
Renner 61fd9aa167
Provide descriptive activation information on error (#296)
When trying to activate using Unity.Licensing.Client, any errors will
provide no output. This change makes sure to provide context as to why
the Unity.Licensing.Client has failed to retrieve a license.

Signed-off-by: J. Renner <joao.renner@virtualisurg.com>
2025-08-01 13:26:43 -05:00
Gabriel Le Breton 0483262850
Add warning for invalid nunit xml files (#286)
* Allow ResultsParser to fail on non-nunit xml files

* yarn build

* Add file check for NUnit XML format before parsing

* yarn build

* Update src/model/results-check.ts

Co-authored-by: Koji Hasegawa <hasegawa@nowsprinting.com>

---------

Co-authored-by: Koji Hasegawa <hasegawa@nowsprinting.com>
2024-11-08 23:43:21 +01:00
Joe Anderson 05a00ef5ac
Fix: Debug.LogError annotation point not parsed correctly (#279) 2024-07-20 14:25:59 -05:00
David Finol 0ff419b913
Fix GitHub Issue #214 (#274) 2024-06-15 11:17:55 -07:00
David Finol e0e796f3d9
Fix README.md typo (#273) 2024-06-12 06:16:26 -05:00
nic van dessel eba7e93e66
feat: support private scoped registry on ubuntu (#272) 2024-06-03 19:06:26 +02:00
Andrew Kahr 5817131b76
Parity with unity builder image version regex (#267) 2024-05-07 12:08:32 +02:00
Andrew Kahr fea469be8c
Support new unity versioning scheme with regex matching groups (#264)
* Support new unity versioning scheme with regex matching groups

* Update github action packages

* Pin windows runner image version to 2022. Fix artifact name. Remove max-parallel cap for tests
2024-05-06 22:49:20 +01:00
Sokuhatiku 75d0d76deb
fix: Action did not work on Windows runners. (#257)
* Remove symlink files

* Update entrypoint scripts for windows runner

* Add windows runner tests

* Fix unity editor path

* Set -nographics option for avoid d3d11 initialization error

* Fix Unity project path in windows standalone build script
2024-03-21 14:12:35 +01:00
Quake 35b5a08132
fix: add check before performing chmod on the code coverage path (#262)
* fix: add check before performing chmod on the code coverage path, as it does not exist if the package is not installed

* fix: generalise the dir not existing message more

* fix: improve guide message

---------

Co-authored-by: Quake <QuakeEye@users.noreply.GitHub.com>
2024-03-15 01:25:44 +01:00
nic van dessel 317261b223
fix(package-mode): scoped registry manifest conditional (#263)
* fix: registry incorrectly added to manifest when package testing

* fix scopes conditional

---------

Co-authored-by: Tobias Perelstein <5562156+tobocop2@users.noreply.github.com>
2024-03-14 14:18:56 -04:00
nic van dessel 9d8ff067a3
Add support for Scoped Registries (#261)
* add: new inputs and method params

* feat: add scoped registry to manifest

* feat: setup test job

* fix(workflow): revert change from license to serial

* feat: support private scoped registries

* fix: multiple scopes
2024-03-14 17:13:12 +01:00
Falko 7c242f70d9
Set fullProjectPath variable in entrypoint.sh (#256)
* Set fullProjectPath variable in entrypoint.sh (#255)

* Add test that runs as host user

This should catch bugs like the one described in #255.
2023-12-25 11:53:38 +01:00
Andrew Kahr ce074787fb
Unity builder v4 Parity Update (#246)
- Updated activation strategy to align with builder strategy for more stable activation with retry logic
- Added `containerRegistryImageVersion` and `containerRegistryRepository` for improved custom image support
- Added `runAsHostUser` to fix self-hosted runner issues
- Scripts folder cleanup
- Added error/warning annotations for activation issues
- Improved serial masking
- Image environment factory addition and docker refactoring
2023-12-12 22:12:36 -08:00
dependabot[bot] c80d9094f5
Bump actions/setup-node from 3 to 4 (#243)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-04 20:59:00 -07:00
David Finol 8bb2cdbd2c
Update windows images and add docker parameters (#244)
* Update windows images and add docker parameters

* Run yarn-audit-fix
2023-11-04 22:50:09 -05:00
dependabot[bot] 7b6d529621
Bump actions/checkout from 3 to 4 (#239) 2023-10-31 19:15:28 -07:00
dependabot[bot] cf54cef2d1
Bump actions/upload-artifact from 2 to 3 (#229) 2023-10-31 19:14:46 -07:00
Kuma ca5119b29e
Wrap "Project Directory" lines to fix dir/ls for paths with spaces (#241) 2023-10-31 19:13:46 -07:00
Ely Ronnen 275df9854c
add sshPublicKeysDirectoryPath and GIT_CONFIG_EXTENSIONS parameters that adds git configs and mounts .ssh/config and public keys to the container, in order to allow multiple sh deploy key trick by webplatform@ssh-agent (#240) 2023-09-06 23:35:36 +02:00
Elias 9d0bc623a7
Update image rolling version (#238) 2023-08-22 12:17:10 +02:00
Elias 6ed138a47c
update unity versions (#236) 2023-08-21 21:34:48 +02:00
Aaron Trudeau 7787abf249
Add Feature to test Unity Packages (#164)
* (should fail) add jq install to docker image

* (might fail) remove rm rf call

* move things around to try to fix test

* Revert "(might fail) remove rm rf call"

This reverts commit 22f74ebca7.

* remove silent setting from docker test

* Fix failing test's Docker image

* Add new input and basic test

* Add test package; start using jq cli

* Use test package in test workflow

* Create temporary Unity Project and run tests

* Test removing jq install from Dockerfile

* Revert "Test removing jq install from Dockerfile"

This reverts commit 6aa7a6f443.

* Remove mkdir call

* remove duplicate command

* add packageMode option back in

* build changes

* check for apt-get before installing jq

* change apt-get version check message

* spelling and documentation fixes

* add working example unity package with tests

* add temp pwd call to help figure out absolute pathing

* fix workflow package location

* add jq to add package to temp project packages

* try fixing jq calls

* clean up jq calls, fix variable expansion

* try renaming jq args

* try using different arg syntax for jq

* try wrapping args in parentheses

* try using double quotes only

* try changing up quoting

* try properly using string interpolation

* try removing colon

* add string interpolation to key

* omit double quotes from jq call to retrieve package name

* clean up logging

* add rest of workflow tests

* Revert "add rest of workflow tests"

This reverts commit c0bb008b2c.

* add play mode test without cache

* add package mode all mode workflow step

* add consecutive ppackage mode workflow step

* add package mode "like in the readme" test

* fix workflow syntax error

* try to fix syntax error again

* use correct folder

* *hopefully actually* use correct package path

* try adding caching to "readme" test

* remove caching/mentions of caching from package mode tests

* fix artifacts paths

* fix artifacts pathing and names

* fix combined artifacts for package mode

* clean up documentation and exit code

* clarify allowed docker images for packageMode

* update README to mention Unity packages

* move package name validation to TS part of action

* improve logging for temp project creation failure

* make husky hook executable

* add error for missing tests folder

* update docs to reflect unsupported packages

* remove jq install

* Revert "remove jq install"

This reverts commit bd35ac8f6f.

* TEMP log image in use

* Revert "TEMP log image in use"

This reverts commit 95722dcab4.

* Revert "Revert "remove jq install""

This reverts commit e3bac048b1.

* TEMP list installed packages

* Revert "TEMP list installed packages"

This reverts commit db9c07da38.

* TEMP log project's manifest

* add code coverage package to generated project

* remove temp project manifest log

* add coverage to package mode tests

* update name of package coverage steps

* add codecoverage dependency to test package

* Revert "add codecoverage dependency to test package"

This reverts commit 4b2c03069d.

* add assembly filters for coverage

* TEMP console log project folder

* Revert "TEMP console log project folder"

This reverts commit 411ec51817.

* add logic to copy package to folder without activation file

* fix false positive activation file detection

* fix improper bash "if" formatting

* TEMP remove conditional for package copying

* Revert "TEMP remove conditional for package copying"

This reverts commit 4f12d83889.

* Revert "fix improper bash "if" formatting"

This reverts commit acb975bcea.

* Revert "fix false positive activation file detection"

This reverts commit 580c9c14a0.

* Revert "add logic to copy package to folder without activation file"

This reverts commit b20d994b5d.

* run yarn build

* move package mode check lower in the file

* throw error if unity version is auto in package mode

* fix unity version error wording

* try deleting activate license file

* try logging hidden package files

* try deleting all non-package files

* fix license activation files deletion

* scrap file removals and print dir permissions

* log permissions for package folder

* Add packageMode inputs to main

* fix fs mocks and run yarn build

* fix documentation and add error message for missing jq

* add clarification on package mode caveats

* fix line endings problem (?)

* Revert "fix line endings problem (?)"

This reverts commit 1cba302bc4.

* Revert "add clarification on package mode caveats"

This reverts commit fb62d36ba1.

* Revert "fix documentation and add error message for missing jq"

This reverts commit 0df3ab6b88.

* Redo the input docs fixes

* Redo the jq presence test

* update readme to indicate package mode caveats

* fix wording on coverageOptions

* one more wording fix on coverageOptions

* move sample package to example.com domain

---------

Co-authored-by: Aaron Trudeau <120415438+trudeaua-vividream-software@users.noreply.github.com>
2023-07-03 17:09:20 +02: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
dependabot[bot] cfa9076acb
Bump json5 from 1.0.1 to 1.0.2 (#213)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-07 21:01:36 +01:00
David Finol d982116b88
Run linting (#207) 2022-12-24 23:45:38 +01:00
hubert b9980d6db7
Trims output length to avoid hitting github 2Mb limitation (#206)
Co-authored-by: ahub <ahub@riseup.net>
2022-12-16 13:44:40 -06:00
dependabot[bot] 34809a534f
Bump minimatch from 3.0.4 to 3.1.2 (#203)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-04 01:26:08 +01:00
dependabot[bot] 677bd599b0
Bump decode-uri-component from 0.2.0 to 0.2.2 (#204)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-04 01:25:49 +01:00
Nick Maltbie be0f55d3cf
Added dontClear coverage flag to default coverage options (#202) 2022-12-04 01:21:13 +01:00
simensan 42c28a953e
Add unityLicensingServer to action.yml so warning for input dissapears (#201) 2022-11-29 12:03:21 +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
Paul Pacheco 3bffd88e03
upgrade to node 16 (#193)
node12 actions are deprecated.
See documentation here:
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

Currently, the unity builder action gives me the following warning:
```
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: game-ci/unity-test-runner, game-ci/unity-builder
```
2022-10-13 23:19:52 +02:00
Paul Pacheco 45ec546c43
upgrade actions/core to 1.10.0 (#194)
* 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
2022-10-13 23:17:35 +02:00
Webber Takken 26c9b7abe1
Update FUNDING.yml (#192) 2022-09-17 13:50:07 -04:00
dependabot[bot] 811160c5b3
Bump @actions/core from 1.6.0 to 1.9.1 (#191)
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.6.0 to 1.9.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-20 01:15:06 +02: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
Nick Maltbie d95f760d49
Changed eableCyclomaticComplexity to generateAdditionalMetrics (#183)
* Changed eableCyclomaticComplexity to generateAdditionalMetrics for coverageOptions

* updated codecoverage to version 1.1.1
2022-04-22 01:08:44 +02: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
dependabot[bot] ec4f39253f
Bump actions/upload-artifact from 2 to 3 (#180)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 12:24:59 +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
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
dependabot[bot] 29ad0eb103
Bump minimist from 1.2.5 to 1.2.6 (#174)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-27 03:01:26 +02:00
Paul Pacheco 8324e03548
Rebuild after docker.sock:z fix (#173) 2022-03-23 19:42:20 +01:00
Paul Pacheco 33bc4be9fa
fix: operation not permitted in self hosted runners (#172)
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.
2022-03-23 14:14:44 +01:00