diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 219daa0c4b..5b1bca3c63 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -46,6 +46,10 @@ jobs: - os: ubuntu-18.04 build_type: android apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0 + # Do not change the names of self-hosted runners without knowing what you are doing, as they correspond to labels that have to be set on the runner. + - os: self-hosted_debian-11_aarch64 + build_type: full + apt-dependencies: qtbase5-dev qtbase5-private-dev qtwebengine5-dev qtwebengine5-dev-tools qtmultimedia5-dev libqt5opengl5-dev qtscript5-dev libqt5scripttools5 libqt5webchannel5-dev libqt5websockets5-dev qtxmlpatterns5-dev-tools qttools5-dev libqt5xmlpatterns5-dev libqt5svg5-dev qml-module-qtwebchannel build-essential cmake curl freeglut3-dev git libasound2 libasound2-dev libdouble-conversion-dev libdrm-dev libfontconfig1 libgl1-mesa-dev libglvnd-dev libharfbuzz-dev libjack-dev libjack0 libnspr4 libnss3 libpcre2-16-0 libpulse0 libsdl2-dev libssl-dev libudev-dev libxcb-xinerama0-dev libxcb-xinput0 libxcomposite1 libxcursor1 libxi-dev libxmu-dev libxrandr-dev libxslt1.1 libxtst6 make mesa-common-dev mesa-utils nodejs npm patchelf python2 python3 python3-distro xdg-user-dirs zlib1g-dev ninja-build zip fail-fast: false runs-on: ${{matrix.os}} if: github.event.action != 'labeled' || github.event.label.name == 'rebuild' @@ -59,10 +63,19 @@ jobs: echo "APP_TARGET_NAME=$APP_NAME" >> $GITHUB_ENV # Linux build variables - if [[ "${{ matrix.os }}" = "ubuntu-"* ]]; then + if [[ "${{ matrix.os }}" = "ubuntu-"* || "${{ matrix.os }}" = *"debian"* ]]; then echo "PYTHON_EXEC=python3" >> $GITHUB_ENV echo "INSTALLER_EXT=*" >> $GITHUB_ENV - echo "CMAKE_BUILD_EXTRA=-- -j3" >> $GITHUB_ENV + if [ "${{ matrix.os }}" = "self-hosted_debian-11_aarch64" ]; then + echo "CMAKE_BUILD_EXTRA=-- -j4" >> $GITHUB_ENV + else + echo "CMAKE_BUILD_EXTRA=-- -j3" >> $GITHUB_ENV + fi + if [ "${{ matrix.os }}" = "self-hosted_debian-11_aarch64" ]; then + echo "VIRCADIA_USE_SYSTEM_QT=true" >> $GITHUB_ENV + echo "VCPKG_FORCE_SYSTEM_BINARIES=true" >> $GITHUB_ENV + echo "CI_WORKSPACE=${{runner.workspace}}" >> $GITHUB_ENV + fi if [ "${{ matrix.build_type }}" = "full" ]; then echo "CMAKE_EXTRA=-DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV else @@ -97,6 +110,7 @@ jobs: mkdir $HIFI_ANDROID_PRECOMPILED echo "INSTALLER_EXT=apk" >> $GITHUB_ENV fi + # Configuration is broken into two steps because you can't set an env var and also reference it in the same step - name: Configure Build Environment 2 shell: bash @@ -114,8 +128,9 @@ jobs: else echo "ARTIFACT_PATTERN=*.$INSTALLER_EXT" >> $GITHUB_ENV fi + - name: Clear Working Directory - if: startsWith(matrix.os, 'windows') + if: startsWith(matrix.os, 'windows') || matrix.os == 'self-hosted_debian-11_aarch64' shell: bash working-directory: ${{runner.workspace}} run: rm -rf ./* @@ -123,9 +138,10 @@ jobs: with: submodules: false fetch-depth: 1 + - name: Install dependencies shell: bash - if: startsWith(matrix.os, 'ubuntu') + if: startsWith(matrix.os, 'ubuntu') || contains(matrix.os, 'debian') run: | echo "Installing Python Modules:" pip3 install distro || exit 1 @@ -135,13 +151,16 @@ jobs: echo "Installing apt packages" sudo apt install -y ${{ matrix.apt-dependencies }} || exit 1 + - name: Create Build Environment shell: bash run: cmake -E make_directory "${{runner.workspace}}/build" + - name: Configure CMake working-directory: ${{runner.workspace}}/build shell: bash run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DVCPKG_BUILD_TYPE=release $CMAKE_EXTRA + - name: Compress cmake logs if: always() shell: bash @@ -152,7 +171,12 @@ jobs: TAR=tar fi - find "$HOME/vircadia-files/vcpkg" -name '*log' -type f -print0 | $TAR --null --force-local -T - -c --xz -v -f "${{ runner.workspace }}/cmake-logs-${{ matrix.os }}-${{ github.event.number }}.tar.xz" + if [ ${{ env.CI_WORKSPACE }} ]; then + find "$CI_WORKSPACE/vircadia-files/vcpkg" -name '*log' -type f -print0 | $TAR --null --force-local -T - -c --xz -v -f "${{ runner.workspace }}/cmake-logs-${{ matrix.os }}-${{ github.event.number }}.tar.xz" + else + find "$HOME/vircadia-files/vcpkg" -name '*log' -type f -print0 | $TAR --null --force-local -T - -c --xz -v -f "${{ runner.workspace }}/cmake-logs-${{ matrix.os }}-${{ github.event.number }}.tar.xz" + fi + - name: Archive cmake logs if: always() uses: actions/upload-artifact@v2 @@ -160,26 +184,31 @@ jobs: name: cmake-logs-${{ matrix.os }}-${{ github.event.number }}.tar.xz path: ${{ runner.workspace }}/cmake-logs-${{ matrix.os }}-${{ github.event.number }}.tar.xz if-no-files-found: error + - name: Build Application if: matrix.build_type == 'full' || matrix.build_type == 'client' working-directory: ${{runner.workspace}}/build shell: bash run: cmake --build . --config $BUILD_TYPE --target $APP_TARGET_NAME $CMAKE_BUILD_EXTRA + - name: Build Domain Server if: matrix.build_type == 'full' working-directory: ${{runner.workspace}}/build shell: bash run: cmake --build . --config $BUILD_TYPE --target domain-server $CMAKE_BUILD_EXTRA + - name: Build Assignment Client if: matrix.build_type == 'full' working-directory: ${{runner.workspace}}/build shell: bash run: cmake --build . --config $BUILD_TYPE --target assignment-client $CMAKE_BUILD_EXTRA + - name: Build Console if: matrix.build_type == 'full' || matrix.os == 'windows-latest' working-directory: ${{runner.workspace}}/build shell: bash run: cmake --build . --config $BUILD_TYPE --target packaged-server-console $CMAKE_BUILD_EXTRA + - name: Build Installer if: matrix.build_type != 'android' working-directory: ${{runner.workspace}}/build @@ -218,6 +247,7 @@ jobs: working-directory: ${{runner.workspace}}/vircadia run: | /usr/local/lib/android/sdk/tools/bin/sdkmanager --uninstall 'cmake;3.18.1' + - name: Build for Android + Quest if: matrix.build_type == 'android' shell: bash @@ -230,6 +260,7 @@ jobs: ./gradlew -m tasks -PHIFI_ANDROID_PRECOMPILED=$HIFI_ANDROID_PRECOMPILED # Build! ./build_android.sh + - name: Output system stats if: ${{ always() }} working-directory: ${{runner.workspace}}/build @@ -237,11 +268,13 @@ jobs: run: | echo "Disk usage:" df -h + - name: Output Installer Logs if: failure() && matrix.os == 'windows-latest' shell: bash working-directory: ${{runner.workspace}}/build run: cat ./_CPack_Packages/win64/NSIS/NSISOutput.log + - name: Upload Artifact shell: bash working-directory: ${{runner.workspace}}/build