Attempt to port some build.yaml improvements from DRTVWR-559 over to actions branch

master
Brad Linden 2023-06-07 13:46:29 -07:00
parent 8140dd050e
commit f57de07f73
2 changed files with 45 additions and 20 deletions

View File

@ -5,18 +5,22 @@ on:
pull_request: pull_request:
push: push:
branches: ["actions"] branches: ["actions"]
tags: ["*"]
jobs: jobs:
build: build:
strategy: strategy:
matrix: matrix:
runner: [windows-2022, macos-11] runner: [windows-large, macos-12-xl]
configuration: [Release] configuration: [Release]
addrsize: [64] addrsize: [64]
python-version: ["3.11"]
include: include:
- runner: windows-2022 - runner: windows-large
configuration: Release configuration: Release
addrsize: 32 addrsize: 32
- runner: macos-12-xl
developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer"
runs-on: ${{ matrix.runner }} runs-on: ${{ matrix.runner }}
env: env:
AUTOBUILD_ADDRSIZE: ${{ matrix.addrsize }} AUTOBUILD_ADDRSIZE: ${{ matrix.addrsize }}
@ -26,6 +30,7 @@ jobs:
AUTOBUILD_INSTALLABLE_CACHE: ${{ github.workspace }}/.autobuild-installables AUTOBUILD_INSTALLABLE_CACHE: ${{ github.workspace }}/.autobuild-installables
AUTOBUILD_VARIABLES_FILE: ${{ github.workspace }}/.build-variables/variables AUTOBUILD_VARIABLES_FILE: ${{ github.workspace }}/.build-variables/variables
AUTOBUILD_VSVER: "170" AUTOBUILD_VSVER: "170"
DEVELOPER_DIR: ${{ matrix.developer_dir }}
# Ensure that viewer builds engage Bugsplat. # Ensure that viewer builds engage Bugsplat.
BUGSPLAT_DB: "SecondLife_Viewer_2018" BUGSPLAT_DB: "SecondLife_Viewer_2018"
# Setting this variable directs Linden's TUT test driver code to capture # Setting this variable directs Linden's TUT test driver code to capture
@ -35,9 +40,18 @@ jobs:
# if unit tests fail to import llsd (i.e. wrong Python interpreter), # if unit tests fail to import llsd (i.e. wrong Python interpreter),
# make py.exe enumerate the possibilities and explain its choice # make py.exe enumerate the possibilities and explain its choice
PYLAUNCHER_DEBUG: "1" PYLAUNCHER_DEBUG: "1"
GIT_REF: ${{ github.head_ref || github.ref }}
LL_SKIP_REQUIRE_SYSROOT: 1
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout build variables - name: Checkout build variables
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -55,16 +69,13 @@ jobs:
with: with:
path: .autobuild-installables path: .autobuild-installables
key: ${{ runner.os }}-${{ matrix.addrsize }}-${{ matrix.configuration }}-${{ hashFiles('autobuild.xml') }} key: ${{ runner.os }}-${{ matrix.addrsize }}-${{ matrix.configuration }}-${{ hashFiles('autobuild.xml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.addrsize }}-${{ matrix.configuration }}-
${{ runner.os }}-${{ matrix.addrsize }}-
- name: Install windows dependencies - name: Install windows dependencies
if: runner.os == 'Windows' if: runner.os == 'Windows'
# Use 'py -m pip' because our autobuild.xml specifies py.exe as run: choco install nsis-unicode
# PYTHON_EXECUTABLE, and we've tried all kinds of tricks to make pip
# install the 'llsd' package into the Python interpreter selected by
# py.exe.
run: |
choco install nsis-unicode
py -m pip install autobuild llsd
- name: Build - name: Build
id: build id: build
@ -72,9 +83,18 @@ jobs:
env: env:
RUNNER_OS: ${{ runner.os }} RUNNER_OS: ${{ runner.os }}
run: | run: |
autobuild configure # On windows we need to point the build to the correct python
# as neither CMake's FindPython nor our custom Python.cmake module
# will resolve the correct interpreter location.
if [[ "$RUNNER_OS" == "Windows" ]]; then
export PYTHON="$(cygpath -m "$(which python)")"
echo "Python location: $PYTHON"
fi
autobuild configure -- -DVIEWER_CHANNEL="Second Life Test ${GIT_REF##*/}"
autobuild build --no-configure autobuild build --no-configure
# Find artifacts
if [[ "$RUNNER_OS" == "Windows" ]]; then if [[ "$RUNNER_OS" == "Windows" ]]; then
installer_path=$(find ./build-*/newview/ | grep '_Setup\.exe') installer_path=$(find ./build-*/newview/ | grep '_Setup\.exe')
installer_name="$(basename $installer_path)" installer_name="$(basename $installer_path)"
@ -82,8 +102,9 @@ jobs:
installer_path=$(find ./build-*/newview/ | grep '\.dmg') installer_path=$(find ./build-*/newview/ | grep '\.dmg')
installer_name="$(basename $installer_path)" installer_name="$(basename $installer_path)"
fi fi
echo "::set-output name=installer_path::$installer_path"
echo "::set-output name=installer_name::$installer_name" echo "installer_path=$installer_path" >> $GITHUB_OUTPUT
echo "installer_name=$installer_name" >> $GITHUB_OUTPUT
- name: Upload installer - name: Upload installer
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -173,6 +173,9 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}") set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}")
message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'") message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'")
# allow disabling this check by setting LL_SKIP_REQUIRE_SYSROOT either ON as cmake cache var or non-empty as environment var
set(LL_SKIP_REQUIRE_SYSROOT OFF CACHE BOOL "Skip requirement to set toolchain sysroot ahead of time. Not skipped by default for consistency, but skipping can be useful for selecting alternative xcode versions side by side")
if("$ENV{LL_SKIP_REQUIRE_SYSROOT}" STREQUAL "" AND NOT ${LL_SKIP_REQUIRE_SYSROOT})
string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}") string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}")
list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx) list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx)
if ("${sysroot_idx}" LESS 0) if ("${sysroot_idx}" LESS 0)
@ -180,6 +183,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif () endif ()
math(EXPR sysroot_idx "${sysroot_idx} + 1") math(EXPR sysroot_idx "${sysroot_idx} + 1")
list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT) list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT)
endif()
message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'") message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'")
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0") set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")