Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCodebuild Environment Variable Setup #314

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
11 changes: 11 additions & 0 deletions builder/actions/setup_cross_ci_crt_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,21 @@


class SetupCrossCICrtEnvironment(Action):
""" Setup Environment Variables for CI Unit Tests """

def __init__(self, use_xcodebuild=False):
# is_xcodebuild set to true if using Apple XCodebuild
self.is_xcodebuild = use_xcodebuild

def _setenv(self, env, env_name, env_data, is_secret=False):
# Kinda silly to have a function for this, but makes the API calls consistent and looks better
# beside the other functions...

# XCodebuild will passing env var with "TEST_RUNNER_" prefix into tests. Setup the builder to add
# "TEST_RUNNER_" to environment variables when use xcodebuild.
# (https://developer.apple.com/documentation/xcode/environment-variable-reference)
if self.is_xcodebuild:
env_name = "TEST_RUNNER_"+env_name
env.shell.setenv(env_name, str(env_data), is_secret=is_secret)
# Set it in the test environment as well, for C++
env.project.config['test_env'][env_name] = env_data
Expand Down
Loading