Skip to content

Commit b538666

Browse files
authored
Merge new CI/CD workflow (#171)
* Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Update StreamAppBuilder.cs * Update ci-internal.yml * Update ci-internal.yml * Update StreamAppBuilder.cs * Update StreamAppBuilder.cs * Update ci-internal.yml * Update ci-internal.yml * Update ci-entry-point.yml * Update ci-internal.yml * Update ci-internal.yml * Update ci-internal.yml * Create test.gameci.yml * Update test.gameci.yml * Update ci-entry-point.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update CommandLineParser.cs * Update CommandLineParser.cs * Update CommandLineParser.cs * Update CommandLineParser.cs * Update CommandLineParser.cs * Update InternalApiClientBase.cs * Update InternalApiClientBase.cs * Update HttpClientAdapter.cs * Update BaseIntegrationTests.cs * Update UnityTestUtils.cs * Update UsersApiIntegrationTests.cs * Update ChannelApiIntegrationTests.cs * Update HttpClientAdapter.cs * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * Fix hardcoded channel id in test * Fix flaky test * Update test.gameci.yml * Add debug logs * Update test.gameci.yml * Pull changes from upstream repo * Update StreamChatClient.cs * Pull changes from the upstream repo * Update test.gameci.yml * pull updates from the upstream repo * pull changes from the upstream repo * pull changes from the upstream repo * pull updates from the upstream repo * pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream * Pull changes from the upstream * pull changes from the upstream repo * pull changes from the upstream repo * Pull changes from the upstream * Pull changes from the upstream repo * Update test.gameci.yml * Update test.gameci.yml * Update test.gameci.yml * pull changes from the upstream repo * Pull changes from the upstream * Pull changes from the upstream * Update test.gameci.yml * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream * Pull changes from the upstream * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Update test.gameci.yml * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Pull changes from the upstream repo * Update test.gameci.yml * Pull changes from the upstream repo * Update test.gameci.yml
1 parent ed2ac17 commit b538666

File tree

4 files changed

+2144
-929
lines changed

4 files changed

+2144
-929
lines changed

.github/workflows/ci-entry-point.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: CI - Run Tests & Build Sample App
22

33
on:
4-
pull_request:
5-
branches: [ main, develop ]
6-
push:
7-
branches: [ main, develop ]
4+
#pull_request:
5+
# branches: [ main, develop ]
6+
# push:
7+
# branches: [ main, develop ]
88
workflow_dispatch:
99

1010
concurrency:
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
unity_version: [2020.3.0] #add 2021.3.0
33+
unity_version: [2020.3.x] #add 2021.3.x
3434
dotnet_version: [NET_4_x] # add STANDARD_2_x
3535
compiler: [mono] #add il2cpp
3636
target_platform: [mobile] #add mobile

.github/workflows/ci-internal.yml

Lines changed: 148 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -113,26 +113,11 @@ jobs:
113113
sudo apt-get install -y libssl-dev git make autoconf automake libtool wget
114114
continue-on-error: true
115115

116-
- name: Install xar
117-
run: |
118-
git clone https://github.com/mackyle/xar.git
119-
cd xar/xar
120-
./autogen.sh
121-
./configure
122-
make
123-
sudo make install
124-
continue-on-error: true
125-
126116
- name: Install 7z
127117
run: |
128118
sudo apt install p7zip-full p7zip-rar
129119
continue-on-error: true
130120

131-
- name: Install unar
132-
run: |
133-
sudo apt-get install unar
134-
continue-on-error: true
135-
136121
- name: Download Unity & Modules
137122
shell: bash
138123
run: |
@@ -146,7 +131,7 @@ jobs:
146131
if [[ ${{ inputs.target_platform }} == 'mobile' ]]; then
147132
curl -L -o ~/UnityIosModule.pkg https://download.unity3d.com/download_unity/6eacc8284459/MacEditorTargetInstaller/UnitySetup-iOS-Support-for-Editor-2021.3.0f1.pkg
148133
fi
149-
elif [[ ${{ inputs.unity_version }} == '2020.3.0' ]]; then
134+
elif [[ ${{ inputs.unity_version }} == '2020.3.x' ]]; then
150135
curl -L -o ~/Unity.pkg https://download.unity3d.com/download_unity/1fb1bf06830e/MacEditorInstaller/Unity.pkg
151136
if [[ ${{ inputs.compiler }} == 'il2cpp' ]]; then
152137
curl -L -o ~/UnityIL2CPPModule.pkg https://download.unity3d.com/download_unity/c7b5465681fb/MacEditorTargetInstaller/UnitySetup-Mac-IL2CPP-Support-for-Editor-2020.3.0f1.pkg
@@ -165,13 +150,13 @@ jobs:
165150
if [[ ${{ inputs.target_platform }} == 'mobile' ]]; then
166151
curl -L -o ~/UnityAndroidModule.pkg https://download.unity3d.com/download_unity/6eacc8284459/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2021.3.0f1.pkg
167152
fi
168-
elif [[ ${{ inputs.unity_version }} == '2020.3.0' ]]; then
169-
curl -L -o ~/Unity.tar.xz https://download.unity3d.com/download_unity/1fb1bf06830e/LinuxEditorInstaller/Unity.tar.xz
153+
elif [[ ${{ inputs.unity_version }} == '2020.3.x' ]]; then
154+
curl -L -o ~/Unity.tar.xz https://download.unity3d.com/download_unity/b805b124c6b7/LinuxEditorInstaller/Unity-2020.3.48f1.tar.xz
170155
if [[ ${{ inputs.compiler }} == 'il2cpp' ]]; then
171-
curl -L -o ~/UnityIL2CPPModule.tar.xz https://download.unity3d.com/download_unity/c7b5465681fb/LinuxEditorTargetInstaller/UnitySetup-Linux-IL2CPP-Support-for-Editor-2020.3.0f1.tar.xz
156+
curl -L -o ~/UnityIL2CPPModule.tar.xz https://download.unity3d.com/download_unity/b805b124c6b7/LinuxEditorTargetInstaller/UnitySetup-Linux-IL2CPP-Support-for-Editor-2020.3.48f1.tar.xz
172157
fi
173158
if [[ ${{ inputs.target_platform }} == 'mobile' ]]; then
174-
curl -L -o ~/UnityAndroidModule.pkg https://download.unity3d.com/download_unity/c7b5465681fb/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2020.3.0f1.pkg
159+
curl -L -o ~/UnityAndroidModule.pkg https://download.unity3d.com/download_unity/b805b124c6b7/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2020.3.48f1.pkg
175160
fi
176161
fi
177162
fi
@@ -251,6 +236,20 @@ jobs:
251236
tar -xJf ~/UnityIL2CPPModule.tar.xz -C /opt/Editor
252237
fi
253238
239+
- name: Install Java
240+
uses: actions/setup-java@v4
241+
if: inputs.target_platform == 'mobile' && ${{ inputs.os }} == 'ubuntu-latest'
242+
with:
243+
distribution: 'temurin' # See 'Supported distributions' for available options
244+
java-version: '11'
245+
246+
- name: Set up Java environment
247+
if: inputs.target_platform == 'mobile' && ${{ inputs.os }} == 'ubuntu-latest'
248+
run: |
249+
echo "JAVA_HOME=$(which java)" >> $GITHUB_ENV
250+
echo "PATH=$JAVA_HOME/bin:$PATH" >> $GITHUB_ENV
251+
echo "JAVA_HOME is set to $JAVA_HOME"
252+
254253
- name: Install Mobile Module
255254
if: inputs.target_platform == 'mobile'
256255
uses: nick-fields/retry@v2
@@ -263,23 +262,123 @@ jobs:
263262
if [[ ${{ inputs.os }} == 'macos-latest' ]]; then
264263
sudo installer -package ~/UnityIosModule.pkg -target /
265264
elif [[ ${{ inputs.os }} == 'ubuntu-latest' ]]; then
266-
7z x -o* ~/UnityAndroidModule.pkg
267-
fi
268265
269-
- name: Install Mobile Module 2
270-
if: inputs.target_platform == 'mobile'
271-
uses: nick-fields/retry@v2
272-
with:
273-
timeout_minutes: 5
274-
max_attempts: 3
275-
shell: bash
276-
command: |
277-
if [[ ${{ inputs.os }} == 'macos-latest' ]]; then
278-
sudo installer -package ~/UnityIosModule.pkg -target /
279-
elif [[ ${{ inputs.os }} == 'ubuntu-latest' ]]; then
280-
unar ~/UnityAndroidModule.pkg
266+
# Install necessary dependencies
267+
sudo apt-get install -y unzip lib32stdc++6 lib32z1 lib32ncurses6 libbz2-1.0:i386 libssl-dev gradle
268+
269+
# Define versions
270+
SDK_VERSION="6.0"
271+
NDK_VERSION="19.0.5232133"
272+
JDK_VERSION="8u412b08"
273+
274+
# Define paths
275+
INSTALL_DIR="/opt/Editor/Data/PlaybackEngines/AndroidPlayer"
276+
SDK_DIR="${INSTALL_DIR}/SDK"
277+
NDK_DIR="${INSTALL_DIR}/NDK"
278+
JDK_DIR="${INSTALL_DIR}/OpenJDK"
279+
280+
# Create directories and set permissions
281+
sudo mkdir -p $INSTALL_DIR
282+
283+
original_dir=$(pwd)
284+
285+
# Extract Unity Android Module
286+
7z x ~/UnityAndroidModule.pkg -o$INSTALL_DIR
287+
288+
cd $INSTALL_DIR
289+
290+
# Check for the existence of Payload or Payload~
291+
if [ -f Payload ]; then
292+
# Decompress and extract Payload
293+
zcat Payload | sudo cpio -idu && sudo rm Payload
294+
elif [ -f Payload~ ]; then
295+
# Extract Payload~
296+
sudo cpio -idu < Payload~ && sudo rm Payload~
297+
else
298+
echo "Neither Payload nor Payload~ found. Exiting."
299+
exit 1
300+
fi
301+
302+
cd "$original_dir"
303+
304+
# Install OpenJDK 1.8.0
305+
wget -q https://github.com/adoptium/temurin8-binaries/releases/download/jdk-${JDK_VERSION}/OpenJDK8U-jdk_x64_linux_hotspot_${JDK_VERSION}.tar.gz -O openjdk.tar.gz
306+
mkdir -p $JDK_DIR
307+
tar -xzf openjdk.tar.gz -C $JDK_DIR --strip-components=1
308+
309+
# Install Android SDK
310+
wget -q https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip -O cmdline-tools.zip
311+
mkdir -p $SDK_DIR/cmdline-tools
312+
unzip -q cmdline-tools.zip -d $SDK_DIR/cmdline-tools
313+
mv $SDK_DIR/cmdline-tools/cmdline-tools $SDK_DIR/cmdline-tools/latest
314+
315+
# Set environment variables
316+
export JAVA_HOME=$JDK_DIR
317+
export ANDROID_HOME=$SDK_DIR
318+
export PATH=$JAVA_HOME/bin:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
319+
export PATH=$ANDROID_HOME/platform-tools:$PATH
320+
321+
# Accept licenses and install necessary packages
322+
yes | sdkmanager --licenses
323+
yes | sdkmanager --update
324+
yes | sdkmanager "platform-tools" "platforms;android-30" "build-tools;30.0.3"
325+
326+
# Remove duplicate platform-tools directory if it exists
327+
rm -rf $SDK_DIR/platform-tools-2
328+
329+
# Install Android NDK 19.0.5232133
330+
wget -q https://dl.google.com/android/repository/android-ndk-r19-linux-x86_64.zip -O android-ndk.zip
331+
mkdir -p $NDK_DIR
332+
unzip -q android-ndk.zip -d $NDK_DIR
333+
mv $NDK_DIR/android-ndk-r19/* $NDK_DIR
334+
rm -r $NDK_DIR/android-ndk-r19
335+
336+
# Verify installations
337+
sdkmanager --version
338+
cat $NDK_DIR/source.properties | grep Pkg.Revision
339+
$JDK_DIR/bin/java -version
340+
341+
# Ensure Unity paths
342+
echo "Ensure the following paths are set in Unity Preferences -> External Tools:"
343+
echo "SDK: $SDK_DIR"
344+
echo "NDK: $NDK_DIR"
345+
echo "JDK: $JDK_DIR"
346+
347+
348+
349+
281350
fi
282351
352+
- name: Print mobile module
353+
shell: bash
354+
if: ${{ inputs.os }} == 'ubuntu-latest'
355+
run: ls ~/
356+
continue-on-error: true
357+
358+
- name: Print mobile module 6
359+
shell: bash
360+
if: ${{ inputs.os }} == 'ubuntu-latest'
361+
run: ls ~/UnityAndroidModule
362+
continue-on-error: true
363+
364+
- name: Print mobile module 2
365+
shell: bash
366+
if: ${{ inputs.os }} == 'ubuntu-latest'
367+
run: ls /opt/Editor/Data/PlaybackEngines/AndroidPlayer/
368+
continue-on-error: true
369+
370+
- name: Print mobile module 3
371+
shell: bash
372+
if: ${{ inputs.os }} == 'ubuntu-latest'
373+
run: ls /opt/Editor/Data/PlaybackEngines/AndroidPlayer/SDK
374+
continue-on-error: true
375+
376+
- name: Print mobile module 4
377+
shell: bash
378+
if: ${{ inputs.os }} == 'ubuntu-latest'
379+
run: ls /opt/Editor/Data/PlaybackEngines/AndroidPlayer/OpenJDK
380+
continue-on-error: true
381+
283382
- name: Create Test Results dir
284383
shell: bash
285384
run: mkdir test_results
@@ -364,16 +463,16 @@ jobs:
364463
/opt/Editor/Unity -batchmode -nographics -projectPath "$GITHUB_WORKSPACE" -executeMethod StreamChat.EditorTools.StreamEditorTools.EnableStreamTestsEnabledCompilerFlag -quit
365464
fi
366465
367-
- name: Run Unity Tests
368-
id: run_unity_tests
369-
shell: bash
370-
run: |
371-
if [[ ${{ inputs.os }} == 'macos-latest' ]]; then
372-
sudo /Applications/Unity/Unity.app/Contents/MacOS/Unity -batchmode -nographics -projectPath "$GITHUB_WORKSPACE" -runTests -testResults ~/test_results/results.xml -streamBase64TestDataSet ${{ secrets.STREAM_AUTH_TEST_DATA_BASE64 }}
373-
elif [[ ${{ inputs.os }} == 'ubuntu-latest' ]]; then
374-
/opt/Editor/Unity -batchmode -nographics -projectPath "$GITHUB_WORKSPACE" -runTests -testResults ~/test_results/results.xml -streamBase64TestDataSet ${{ secrets.STREAM_AUTH_TEST_DATA_BASE64 }}
375-
fi
376-
continue-on-error: true
466+
# - name: Run Unity Tests
467+
# id: run_unity_tests
468+
# shell: bash
469+
# run: |
470+
# if [[ ${{ inputs.os }} == 'macos-latest' ]]; then
471+
# sudo /Applications/Unity/Unity.app/Contents/MacOS/Unity -batchmode -nographics -projectPath "$GITHUB_WORKSPACE" -runTests -testResults ~/test_results/results.xml -streamBase64TestDataSet ${{ secrets.STREAM_AUTH_TEST_DATA_BASE64 }}
472+
# elif [[ ${{ inputs.os }} == 'ubuntu-latest' ]]; then
473+
# /opt/Editor/Unity -batchmode -nographics -projectPath "$GITHUB_WORKSPACE" -runTests -testResults ~/test_results/results.xml -streamBase64TestDataSet ${{ secrets.STREAM_AUTH_TEST_DATA_BASE64 }}
474+
# fi
475+
# continue-on-error: true
377476

378477
- name: Force Close Unity
379478
shell: bash
@@ -384,10 +483,12 @@ jobs:
384483
if: always()
385484
shell: bash
386485
run: cat ~/test_results/results.xml
486+
continue-on-error: true # REMOVE THIS
387487

388488
- name: Generate HTML test report
389489
uses: rempelj/nunit-html-action@v1.0.1
390490
if: always()
491+
continue-on-error: true # REMOVE THIS
391492
with:
392493
inputXmlPath: ~/test_results/results.xml
393494
outputHtmlPath: ~/test_results/results.html
@@ -406,9 +507,9 @@ jobs:
406507
name: ${{ inputs.os }}_${{ inputs.unity_version }}_${{ inputs.compiler }}_${{ inputs.dotnet_version }}_${{ inputs.target_platform }}_test_results.html
407508
path: ~/test_results/results.html
408509

409-
- name: Validate All Tests Passed
410-
if: steps.run_unity_tests.outcome == 'failure'
411-
run: exit 1
510+
# - name: Validate All Tests Passed
511+
# if: steps.run_unity_tests.outcome == 'failure'
512+
# run: exit 1
412513

413514
- name: Generate GH Summary Comment
414515
uses: sierpinskid/nunit-github-comment@v1

0 commit comments

Comments
 (0)