Code Monkey home page Code Monkey logo

Comments (4)

artibex avatar artibex commented on July 18, 2024 2

I FOUND THE ISSUE:

  • Make sure your unity password does not contain special characters that docker does not like
  • Make sure that names, paths etc. do not contain - so it does not confuse docker aswell

from docker.

GabLeRoux avatar GabLeRoux commented on July 18, 2024 1

I took a quick look at this based on shared information. It might be useful to see complete run log. The error message docker: invalid reference format: repository name must be lowercase indicates that there's an issue with the format of the Docker image name being used in the GitHub Actions workflow.

unityci/editor:ubuntu-2022.3.15f1-linux-il2cpp-3 from the Additional details section seems to be a valid docker image name and it is available on docker hub.

Now by looking at the actual output and formatting it properly, I think there's something wrong where the version is deteremined. I don't know what is causing this or if it's a bad copy paste manipulation somewhere, but here's the formatted command:

/usr/bin/docker run \
  --workdir /github/workspace \
  --cidfile /home/runner/work/_temp/container___game-ci_unity-test-runner \
  --rm \
  --env UNITY_EMAIL=*** \
  --env UNITY_PASSWORD=*** \
  --env UNITY_SERIAL=*** \
  --env UNITY_VERSION=[20](https://github.com/artibex/paradogx-private/actions/runs/7403600890/job/20143770675#step:7:21)[22](https://github.com/artibex/paradogx-private/actions/runs/7403600890/job/20143770675#step:7:23).3.15f1 \
  --env PROJECT_PATH=unity \
  --env COVERAGE_OPTIONS=generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;dontClear \
  --env COVERAGE_RESULTS_PATH=CodeCoverage \
  --env ARTIFACTS_PATH=artifacts \
  --env PACKAGE_MODE=false \
  --env RUN_AS_HOST_USER=false \
  --env GITHUB_REF=refs/heads/development \
  --env GITHUB_SHA=a44198843c482973aabc0d7d57a983de73e02881 \
  --env GITHUB_REPOSITORY=artibex/paradogx-private \
  --env GITHUB_ACTOR=artibex \
  --env GITHUB_WORKFLOW=Unity Build \
  --env GITHUB_EVENT_NAME=push \
  --env GITHUB_ACTION=__game-ci_unity-test-runner \
  --env GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json \
  --env RUNNER_OS=Linux \
  --env RUNNER_TOOL_CACHE=/opt/hostedtoolcache \
  --env RUNNER_TEMP=/home/runner/work/_temp \
  --env RUNNER_WORKSPACE=/home/runner/work/paradogx-private \
  --env GIT_CONFIG_EXTENSIONS \
  --env TEST_PLATFORMS=playmode;editmode;COMBINE_RESULTS \
  --env GITHUB_WORKSPACE=/github/workspace \
  --volume /home/runner/work/_temp/_github_home:/root:z \
  --volume /home/runner/work/_temp/_github_workflow:/github/workflow:z \
  --volume /home/runner/work/paradogx-private/paradogx-private:/github/workspace:z \
  --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/test-standalone-scripts:/UnityStandaloneScripts:z \
  --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/platforms/ubuntu:/steps:z \
  --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/unity-config:/usr/share/unity3d/config/:z \
  --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/BlankProject:/BlankProject:z \
  --cpus=2 \
  --memory=6575m \
  --env USE_EXIT_CODE=false \
  unityci/editor:ubuntu-2022.3.15f1-linux-il2cpp-3 \
  /bin/bash -c /steps/entrypoint.sh

The line here seems weird (but I might also be wrong):

  --env UNITY_VERSION=[20](https://github.com/artibex/paradogx-private/actions/runs/7403600890/job/20143770675#step:7:21)[22](https://github.com/artibex/paradogx-private/actions/runs/7403600890/job/20143770675#step:7:23).3.15f1 \

I find it weird that there are links to workflow jobs in the middle of the UNITY_VERSION in there. It could also be a problem with how the logs were copy pasted in above issue description.

The test runner (and the unity builder action) uses the file located in ./ProjectSettings/ProjectVersion.txt (or actually unity/ProjectSettings/ProjectVersion.txt, because you have projectPath: unity) to determine which Unity version to use. Then it builds the name of the image to use inside the action. In your case, 2022.3.15f1.

I'll create a blank project with that same version and try your workflow in a public project to see if this can be reproduced.

edit: tried it here: GabLeRoux/unity-game-ci-v4-test-activation#1 and I got a different problem where the tests never ended. Not sure why. But I did not encounter the issue you shared.

from docker.

artibex avatar artibex commented on July 18, 2024 1

First of all, thank you so much for your quick response!

I used the template from the getting started section from game.ci

I added my Unity licence, email and password as a secret and I adjusted the "projectPath", "buildName" and "targetPlattform"

Template:

name: Actions 😎

on: [push, pull_request]

jobs:
  build:
    name: Build my project ✨
    runs-on: ubuntu-latest
    steps:
      # Checkout (without LFS)
      - name: Checkout repository
        uses: actions/checkout@v4

      # Git LFS
      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v3
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      # 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
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }}

      # 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: WebGL

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

The env variable for the Unity Version of the docker run command is strange indeed, just to make sure I will upgrade my unity project on a second branch to 2023 and check if the issue changes.

EDIT: It does not change, seme error. Perhaps it has something to do with the folder structure?
EDIT2: Hardcoding the unity version also leads to the same error

from docker.

GabLeRoux avatar GabLeRoux commented on July 18, 2024

Interesting, didn't know this was still a problem. I remember having troubles a few years ago when I had special characters such as ! in my password which led to problems in shell scripts. It might be worth mentionning this in the docs near UNITY_PASSWORD.

I wonder if we could spot the places where password is used / passed to docker and figure out the best way to avoid troubles with special characters. 🤔

Anyway, thanks a lot for the feedback!

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.