Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Unity - Runner

CI


GitHub Action to run unity for any Unity project.

This Action also includes SonarScanner and DocFX installs


Usage

Create or edit the file called .github/workflows/main.yml and add a request activation file job

name: Test projecton: [push]jobs:
requestActivationFile:
runs-on: ubuntu-lateststeps:
- name: Checkout repositoryuses: actions/checkout@v2
- name: Request manual activation fileuses: MirageNet/unity-runner@3.1.0id: getManualLicenseFilewith:
entrypoint: /request_activation.sh
- name: Expose as artifactuses: actions/upload-artifact@v1with:
name: Manual Activation Filepath: ${{ steps.getManualLicenseFile.outputs.filePath }}

Commit and push this so it runs once. This will generate a manual activation license request file. Save this file and upload it to https://license.unity3d.com/manual

That will generate a license file for personal. Go back to your github project and navigate to Settings -> Secrets

create a secret called UNITY_LICENSE and paste inside the content of the license file.

You can disable the job by adding if: false() or commenting it out, you only needed it to generate the license.

Add a job to run unity cli on your project. You will need a step to activate unity and another step to run unity with any command line argument you want. For example:

jobs:
testRunnerInEditMode:
name: Test edit mode 📝runs-on: ubuntu-latestenv:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} steps:
# Checkout repository (required to test local actions)
- name: Checkout repositoryuses: actions/checkout@v2
- name: Activate licenseuses: MirageNet/unity-runner@3.1.0with:
entrypoint: /activate.sh
- name: Run testsuses: MirageNet/unity-runner@3.1.0with:
args: -runTests -projectPath .

See the Unity's documentation for a full list of all available argument options.

About

Run tests for any Unity project

Resources

Stars

17 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages