forked from DataDog/dd-sdk-unity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
42 lines (37 loc) · 1.48 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
include:
- 'https://gitlab-templates.ddbuild.io/slack-notifier/v1/template.yml'
variables:
# TODO: Detect unity location in script.
UNITY_VERSION: "2022.3.54f1"
UNITY_SUPPORT_PATH: "/Library/Application Support/Unity/config"
stages:
- unit-test
.shared:
install-dependencies:
- echo 'Installing Unity Hub...'
- brew install --cask unity-hub
- echo 'Installing Unity Editor and Modules...'
# This can fail if Unity is already installed, so || true
- /Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless install --version "$UNITY_VERSION" --module ios android --architecture arm64 --childModules || true
create-server-config:
- vault login -method=aws -no-print
- export UNITY_SERVER_CONFIG=$(vault kv get -field=config kv/aws/arn:aws:iam::486234852809:role/ci-dd-sdk-unity/server-config)
- mkdir -p "$UNITY_SUPPORT_PATH"
- printf "%s\n" "$UNITY_SERVER_CONFIG" > sudo tee "$UNITY_SUPPORT_PATH/services-config.json"
- sudo chmod -R +r "$UNITY_SUPPORT_PATH"
unit-test:
stage: unit-test
tags:
- macos:sonoma
- specific:true
script:
- !reference [.shared, install-dependencies]
- !reference [.shared, create-server-config]
- cd $CI_PROJECT_DIR/tools/scripts
- python3 -m venv venv && ./venv/bin/pip3 install -r requirements.txt
- ./venv/bin/python3 ./run_unit_test.py
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/samples/Datadog Sample/tmp/junit-results*.xml