diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97072f05..99c0410c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -265,6 +265,7 @@ jobs: # Test # ############ - name: Test project + timeout-minutes: 10 uses: game-ci/unity-test-runner@main with: unityVersion: ${{ matrix.version }} diff --git a/images/ubuntu/editor/Dockerfile b/images/ubuntu/editor/Dockerfile index 421814d6..581c1c1d 100644 --- a/images/ubuntu/editor/Dockerfile +++ b/images/ubuntu/editor/Dockerfile @@ -10,7 +10,7 @@ FROM $hubImage AS builder # Install editor ARG version ARG changeSet -RUN unity-hub install --version "$version" --changeset "$changeSet" | tee /var/log/install-editor.log && grep 'Error' /var/log/install-editor.log | exit $(wc -l) +RUN unity-hub install --version "$version" --changeset "$changeSet" | tee /var/log/install-editor.log && grep 'Failed to install\|Error while installing an editor\|Completed with errors' /var/log/install-editor.log | exit $(wc -l) # Install modules for that editor ARG module="non-existent-module" @@ -18,7 +18,7 @@ RUN for mod in $module; do \ if [ "$mod" = "base" ] ; then \ echo "running default modules for this baseOs"; \ else \ - unity-hub install-modules --version "$version" --module "$mod" --childModules | tee /var/log/install-module-${mod}.log && grep 'Missing module' /var/log/install-module-${mod}.log | exit $(wc -l); \ + unity-hub install-modules --version "$version" --module "$mod" --childModules | tee /var/log/install-module-${mod}.log && grep 'Missing module\|Completed with errors' /var/log/install-module-${mod}.log | exit $(wc -l); \ fi \ done \ # Set execute permissions for modules @@ -95,7 +95,7 @@ RUN echo "$version-$module" | grep -q -v '^\(2020.1\|2020.2.0f\|2020.2.1f\).*-we #======================================================================================= # [2018.x-android] Install 'Android SDK 26.1.1' and 'Android NDK 16.1.4479499' #======================================================================================= -RUN echo "$version-$module" | grep -q -v '^\(2018.3\|2018.4\).*android' \ +RUN echo "$version-$module" | grep -q -v '^2018\.[34].*android' \ && exit 0 \ || : \ # Versions @@ -138,28 +138,25 @@ RUN echo "$version-$module" | grep -q -v '^\(2018.3\|2018.4\).*android' \ && echo ". /usr/bin/unity-editor.d/android-2018.3-4.sh" >> ~/.bashrc #======================================================================================= -# [2019.x/2020.x/2021.x-android] Support usage of installed Android SDKs outside of editor +# [2019.x/2020.x/2021.x/2022.x-android] Setup Android SDK and NDK Variables #======================================================================================= RUN echo "$version-$module" | grep -q -vP '^20(?!18).*android' \ && exit 0 \ || : \ # Environment Variables - && export RAW_ANDROID_SDK_ROOT=$(jq -cr '(.[] | select(.id == "android-sdk-platform-tools")).destination' $UNITY_PATH/modules.json) \ + && export RAW_ANDROID_SDK_ROOT=$(jq -cr '(.[] | select(.id | contains("android-sdk-platform-tools"))).destination' $UNITY_PATH/modules.json) \ # We need to replace some characters common to paths that will break the sed expression when expanded && export ESCAPED_UNITY_PATH=$(printf '%s' "$UNITY_PATH" | sed 's/[#\/]/\\\0/g') \ && export ANDROID_SDK_ROOT=$(echo $RAW_ANDROID_SDK_ROOT | sed -e "s/{UNITY_PATH}/$ESCAPED_UNITY_PATH/g") \ && export ANDROID_HOME=${ANDROID_SDK_ROOT} \ - && export RAW_ANDROID_NDK_ROOT=$(jq -cr '(.[] | select(.id == "android-ndk")).destination' $UNITY_PATH/modules.json) \ + && export RAW_ANDROID_NDK_ROOT=$(jq -cr '(.[] | select(.id | contains("android-ndk"))).destination' $UNITY_PATH/modules.json) \ && export ANDROID_NDK_HOME=$(echo $RAW_ANDROID_NDK_ROOT | sed -e "s/{UNITY_PATH}/$ESCAPED_UNITY_PATH/g") \ - && export RAW_JAVA_HOME=$(jq -cr '(.[] | select(.id == "android-open-jdk")).destination' $UNITY_PATH/modules.json) \ + && export RAW_JAVA_HOME=$(jq -cr '(.[] | select(.id | contains("android-open-jdk"))).destination' $UNITY_PATH/modules.json) \ && export ESCAPED_JAVA_HOME=$(echo $RAW_JAVA_HOME | sed -e "s/{UNITY_PATH}/$ESCAPED_UNITY_PATH/g") \ # Unity 2019.x doesn't have the jdk in the modules, so put in a fallback. sdkmanager will fail if invaild && export JAVA_HOME=${ESCAPED_JAVA_HOME:-$UNITY_PATH/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/OpenJDK/Linux} \ && export PATH=$JAVA_HOME/bin:${ANDROID_SDK_ROOT}/tools:${ANDROID_SDK_ROOT}/tools/bin:${ANDROID_SDK_ROOT}/platform-tools:${PATH} \ \ - # Accept licenses - && yes | "${ANDROID_HOME}/tools/bin/sdkmanager" --licenses \ - \ # Update alias 'unity-editor' && { \ echo "export ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}"; \ @@ -171,6 +168,56 @@ RUN echo "$version-$module" | grep -q -vP '^20(?!18).*android' \ # Update '~/.bashrc' to enable using variables when logging in && echo ". /usr/bin/unity-editor.d/android-2019+.sh" >> ~/.bashrc +#======================================================================================= +# [2021.x/2022.x-android] Set CMDLINE Tools Path +#======================================================================================= +RUN echo "$version-$module" | grep -q -vP '^(202[1-9]|20[3-9]).*android' \ + && exit 0 \ + || : \ + && . ~/.bashrc \ + && export RAW_CMDLINE_TOOLS_PATH=$(jq -cr '(.[] | select(.id | contains("android-sdk-command-line-tools"))).renameTo' $UNITY_PATH/modules.json) \ + && export ESCAPED_UNITY_PATH=$(printf '%s' "$UNITY_PATH" | sed 's/[#\/]/\\\0/g') \ + && export ANDROID_CMDLINE_TOOLS_PATH=$(echo $RAW_CMDLINE_TOOLS_PATH | sed -e "s/{UNITY_PATH}/$ESCAPED_UNITY_PATH/g") \ + # Prefer cmdline tools over legacy tools + && export PATH=${ANDROID_CMDLINE_TOOLS_PATH}/bin:${PATH} \ + && { \ + echo "export ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}"; \ + echo "export ANDROID_HOME=${ANDROID_HOME}"; \ + echo "export ANDROID_NDK_HOME=${ANDROID_NDK_HOME}"; \ + echo "export JAVA_HOME=${JAVA_HOME}"; \ + echo "export ANDROID_CMDLINE_TOOLS_PATH=${ANDROID_CMDLINE_TOOLS_PATH}"; \ + echo "export PATH=${PATH}"; \ + } > /usr/bin/unity-editor.d/android-2019+.sh + +#======================================================================================= +# [2019.x/2020.x-android] Accept Android SDK licenses via old sdkmanager +#======================================================================================= +RUN echo "$version-$module" | grep -q -vP '^(20(19|20)).*android' \ + && exit 0 \ + || : \ + && . ~/.bashrc \ + && yes | "${ANDROID_HOME}/tools/bin/sdkmanager" --licenses + +#======================================================================================= +# [2021.x/2022.x-android] Accept Android SDK licenses via new cmdline-tools sdkmanager +#======================================================================================= +RUN echo "$version-$module" | grep -q -vP '^(202[1-9]|20[3-9]).*android' \ + && exit 0 \ + || : \ + && . ~/.bashrc \ + && yes | "${ANDROID_CMDLINE_TOOLS_PATH}/bin/sdkmanager" --licenses + +#======================================================================================= +# [2022.x-android] Fix for symlink issue on Android 2022.2+ +#======================================================================================= +RUN echo "$version-$module" | grep -q -vP '^(2022.[2-9]|202[3-9]|20[3-9]).*android' \ + && exit 0 \ + || : \ + && . ~/.bashrc \ + && cd "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin" \ + # Symlink any file less than 64 bytes to the file name within the file. We assume there are no real files that small + && for f in $(find . -type f -size -64c); do target=$(cat $f) && echo "Making symlink $f -> $target" && rm $f && ln -s $target $f ; done + #======================================================================================= # [webgl] Support audio using ffmpeg (~99MB) #======================================================================================= diff --git a/images/ubuntu/hub/Dockerfile b/images/ubuntu/hub/Dockerfile index 68866f38..bba4b585 100644 --- a/images/ubuntu/hub/Dockerfile +++ b/images/ubuntu/hub/Dockerfile @@ -1,6 +1,6 @@ ARG baseImage="unityci/base" FROM $baseImage -ARG hubVersion="3.0.0" +ARG hubVersion="3.4.2-beta.1" # Hub dependencies RUN apt-get -q update \ @@ -10,6 +10,7 @@ RUN apt-get -q update \ # Install Unity Hub # https://docs.unity3d.com/hub/manual/InstallHub.html#install-hub-linux RUN sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list' \ + && sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb unstable main" > /etc/apt/sources.list.d/unityhub-beta.list' \ && wget -qO - https://hub.unity3d.com/linux/keys/public | apt-key add - \ && apt-get -q update \ && apt-get -q install -y "unityhub=$hubVersion" \ diff --git a/images/windows/hub/Dockerfile b/images/windows/hub/Dockerfile index bc30b2be..e6bcb5d5 100644 --- a/images/windows/hub/Dockerfile +++ b/images/windows/hub/Dockerfile @@ -1,7 +1,6 @@ ARG baseImage="unityci/base:windows-latest" FROM $baseImage -ARG hubVersion="3.0.0" # Install unity hub -RUN choco install unity-hub --version=%hubVersion --no-progress -y +RUN choco install unity-hub --no-progress -y