game-ci / unity-test-runner

Run tests for any Unity project
https://github.com/marketplace/actions/unity-test-runner
MIT License
206 stars 135 forks source link

Inconsistent licence activation #245

Closed ironcutter24 closed 8 months ago

ironcutter24 commented 9 months ago

Bug description

I get an Unclassified error occured while trying to activate license error, even though I can get a successful cloud build with the same licence and credentials.

How to reproduce

Set UNITY_LICENSE, UNITY_EMAIL, UNITY_PASSWORD secrets. UNITY_VERSION = "2022.3.5f1" BUILD_TARGET_PLATFORM = "StandaloneWindows64"

Run main.yml workflow on a Unity 2022.3.5f1 project.

main.yml

name: Actions 😎

on: [push, pull_request]

jobs:
  test:
    name: Test my project 🧪
    runs-on: ubuntu-latest
    steps:
      # Checkout
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          lfs: false

      # Cache
      - uses: actions/cache@v3
        with:
          path: Library
          key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
          restore-keys: |
            Library-

      # Test
      - name: Run tests
        uses: game-ci/unity-test-runner@v4.0.0
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          unityVersion: ${{ secrets.UNITY_VERSION }}

  build:
    name: Build my project ✨
    runs-on: ubuntu-latest
    steps:
      # Checkout
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          lfs: false

      # Cache
      - uses: actions/cache@v3
        with:
          path: Library
          key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
          restore-keys: |
            Library-
      # Build
      - name: Build project
        uses: game-ci/unity-builder@v4
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          targetPlatform: ${{ secrets.BUILD_TARGET_PLATFORM }}
          unityVersion: ${{ secrets.UNITY_VERSION }}
          allowDirtyBuild: true

      # Output
      - uses: actions/upload-artifact@v3
        with:
          name: Build
          path: build

Expected behavior

Licence should be activated and tests should continue.

Additional details

image

End of test log:

...
Status: Downloaded newer image for unityci/editor:ubuntu-2022.3.5f1-linux-il2cpp-3
Changing to "/github/workspace/_activate-license" directory.
/github/workspace/_activate-license /github/workspace
Requesting activation (personal license)
Unclassified error occured while trying to activate license.
Exit code was: 1
Error: The process '/usr/bin/docker' failed with exit code 1
SinhtUp commented 9 months ago

+1

GabLeRoux commented 9 months ago

This is a duplcate of https://github.com/game-ci/unity-test-runner/issues/251. Until we have a fix, there are two possible workarounds:

Workarounds for Unity License Issue

a. Manually Extract the Serial from the License File

Manually extract the serial from the Unity license file:

  1. Locate the License File (depending on your operating system)

    • Windows: C:\ProgramData\Unity\Unity_lic.ulf
    • Mac: /Library/Application Support/Unity/Unity_lic.ulf
    • Linux: ~/.local/share/unity3d/Unity/Unity_lic.ulf
  2. Extract the Serial

    • Follow the logic outlined in the unity-builder script.
    • This involves reading the file, locating the <DeveloperData Value=" tag, extracting the Base64 encoded string, and then decoding it.
    • Discard the first four characters of the decoded string, as they are not part of the serial.

b. Follow Activation Instructions from v3

Alternatively, follow the activation instructions from version 3.

AndrewKahr commented 9 months ago

Can you try game-ci/unity-test-runner@unity-builder-parity and see if the activation issues got better

SinhtUp commented 8 months ago

Can you try game-ci/unity-test-runner@unity-builder-parity and see if the activation issues got better

got through Registration step sucsessfully, now doing the Testing in Playmode step.... looks promising to me!

ironcutter24 commented 8 months ago

Can you try game-ci/unity-test-runner@unity-builder-parity and see if the activation issues got better

Am I missing something? image

AndrewKahr commented 8 months ago

@ironcutter24 the changes were merged last night so the branch was deleted. Try using v4 now

ironcutter24 commented 8 months ago

Works as expected, thank you for addressing the issue this quick!