-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
84 lines (78 loc) · 3.22 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
include:
- 'https://gitlab-templates.ddbuild.io/slack-notifier/v1/template.yml'
variables:
# TODO: Detect unity location in script.
UNITY_VERSION: "2022.3.55f1"
UNITY_SUPPORT_PATH: "/Library/Application Support/Unity/config"
stages:
- unit-test
- package
.shared:
install-dependencies:
- echo 'Installing Unity Hub...'
- brew install --cask unity-hub
- brew install xcbeautify
- 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)
- echo $UNITY_SERVER_CONFIG
- sudo 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"
- ls -la "$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
package-ios:
stage: package
tags:
- macos:sonoma
- specific:true
script:
- !reference [.shared, install-dependencies]
- !reference [.shared, create-server-config]
- export DEMO_CLIENT_TOKEN=$(vault kv get -field=value kv/aws/arn:aws:iam::486234852809:role/ci-dd-sdk-unity/demo_client_token)
- export DEMO_APPLICATION_ID=$(vault kv get -field=value kv/aws/arn:aws:iam::486234852809:role/ci-dd-sdk-unity/demo_application_id)
- cd $CI_PROJECT_DIR/tools/scripts
- ./setup_demo_signing.sh
- python3 -m venv venv && ./venv/bin/pip3 install -r requirements.txt
- ./venv/bin/python3 ./package_demo.py --platform ios --client-token $DEMO_CLIENT_TOKEN --application-id $DEMO_APPLICATION_ID
artifacts:
when: on_success
expire_in: "30 days"
paths:
- samples/Demo Data/Build/iOS/export/*
package-android:
stage: package
tags:
- macos:sonoma
- specific:true
script:
- !reference [.shared, install-dependencies]
- !reference [.shared, create-server-config]
- export DEMO_CLIENT_TOKEN=$(vault kv get -field=value kv/aws/arn:aws:iam::486234852809:role/ci-dd-sdk-unity/demo_client_token)
- export DEMO_APPLICATION_ID=$(vault kv get -field=value kv/aws/arn:aws:iam::486234852809:role/ci-dd-sdk-unity/demo_application_id)
- cd $CI_PROJECT_DIR/tools/scripts
- python3 -m venv venv && ./venv/bin/pip3 install -r requirements.txt
- ./venv/bin/python3 ./package_demo.py --platform android --client-token $DEMO_CLIENT_TOKEN --application-id $DEMO_APPLICATION_ID
artifacts:
when: on_success
expire_in: "30 days"
paths:
- samples/Demo Data/Build/Android/datadog-demo.apk