Skip to content

Commit cfebc90

Browse files
authored
Merge pull request #87 from firebase/fix-firestore
Get Windows build on GHA
2 parents e553cb2 + c541d7c commit cfebc90

File tree

10 files changed

+79
-41
lines changed

10 files changed

+79
-41
lines changed

.github/workflows/android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
inputs:
77
unity_version:
88
description: 'Unity version'
9-
default: '2019.4.30f1'
9+
default: '2019.4.32f1'
1010
required: true
1111
firebase_cpp_sdk_version:
1212
description: 'Firebase CPP SDK version to build against (The branch, tag or SHA to checkout)'

.github/workflows/integration_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
inputs:
99
unity_versions:
1010
description: 'Unity version'
11-
default: '2019.4.30f1'
11+
default: '2019.4.32f1'
1212
required: true
1313
platforms:
1414
description: 'CSV of Android,iOS,Windows,macOS,Linux'

.github/workflows/ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
# Which version of Unity to use
88
unity_version:
99
description: 'Unity version'
10-
default: '2019.4.30f1'
10+
default: '2019.4.32f1'
1111
required: true
1212
firebase_cpp_sdk_version:
1313
description: 'Firebase CPP SDK version to build against (The branch, tag or SHA to checkout)'

.github/workflows/sdk_build.yml

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
inputs:
77
# Which version of Unity to use
88
unity_version:
9-
description: 'Unity version'
10-
default: '2019.4.30f1'
9+
description: 'Unity version [2017.4.40f1, 2018.4.36f1, 2019.4.32f1, 2020.3.22f1]'
10+
default: '2019.4.32f1'
1111
required: true
1212
# Linux uses a different number for its versions
1313
linux_unity_version:
14-
description: 'Linux Unity version'
14+
description: 'Linux Unity version [2017.4.10f1, 2018.4.36f1, 2019.4.32f1, 2020.3.22f1]'
1515
default: '2019.4.32f1'
1616
required: true
1717
# Additional CMake flags to use
@@ -22,12 +22,12 @@ on:
2222

2323
jobs:
2424
build_desktop:
25-
name: build-desktop-${{matrix.os}}
25+
name: build-desktop-${{matrix.os}}-${{matrix.unity_version}}
2626
runs-on: ${{matrix.os}}
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
os: [macos-latest, windows-latest, ubuntu-latest]
30+
os: [windows-latest, macos-latest, ubuntu-latest]
3131
include:
3232
- os: macos-latest
3333
unity_version: ${{ github.event.inputs.unity_version }}
@@ -36,7 +36,7 @@ jobs:
3636
unity_platform_name: macOS,iOS
3737
- os: windows-latest
3838
unity_version: ${{ github.event.inputs.unity_version }}
39-
unity_install_dir: TBD
39+
unity_install_dir: /c/Program Files/Unity_${{ github.event.inputs.unity_version }}
4040
build_dir: windows_unity
4141
unity_platform_name: Windows
4242
- os: ubuntu-latest
@@ -60,11 +60,29 @@ jobs:
6060
path: firebase-cpp-sdk
6161
submodules: true
6262

63+
- name: Support longpaths
64+
if: startsWith(matrix.os, 'windows')
65+
run: git config --system core.longpaths true
66+
67+
# Set up the requirements, and install Unity
68+
# Ruby setup has to happen before python install and setup, to keep the absl config.
69+
- uses: ruby/setup-ruby@v1
70+
with:
71+
ruby-version: 3.0.2
72+
73+
- name: Install Unity installer (U3D)
74+
shell: bash
75+
run: gem install u3d
76+
6377
- name: Setup python
6478
uses: actions/setup-python@v2
6579
with:
6680
python-version: '3.7'
6781

82+
- name: Add msbuild to PATH (windows)
83+
if: startsWith(matrix.os, 'windows')
84+
uses: microsoft/[email protected]
85+
6886
- name: Install prerequisites
6987
shell: bash
7088
run: |
@@ -73,37 +91,42 @@ jobs:
7391
python scripts/gha/install_prereqs_desktop.py
7492
cd ..
7593
76-
# Set up the requirements, and install Unity
77-
- uses: ruby/setup-ruby@v1
78-
with:
79-
ruby-version: 2.6
80-
- name: Install Unity installer (U3D)
81-
shell: bash
82-
run: gem install u3d
8394
- name: Install python deps
8495
shell: bash
8596
run: |
8697
pip install -r scripts/gha/requirements.txt
87-
- name: Install Unity
88-
shell: bash
89-
run: |
90-
python scripts/gha/unity_installer.py --install --platforms ${{ matrix.unity_platform_name }} --version ${{ matrix.unity_version }}
91-
- name: Setup Unity path
92-
shell: bash
98+
99+
- name: Install OpenSSL (Windows)
100+
if: startsWith(matrix.os, 'windows')
93101
run: |
94-
echo "UNITY_ROOT_DIR=${{ matrix.unity_install_dir }}" >> $GITHUB_ENV
102+
choco install openssl -r
95103
96104
- name: Install OpenSSL (Linux)
97105
if: startsWith(matrix.os, 'ubuntu')
98106
run: |
99107
sudo apt install openssl
108+
100109
- name: Install OpenSSL (macOS)
101110
if: startsWith(matrix.os, 'macos')
102111
run: |
103112
brew install openssl
104113
# brew won't overwrite MacOS system default OpenSSL, so force it here.
105114
echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl --installed)" >> $GITHUB_ENV
106115
116+
- name: Install Unity
117+
shell: bash
118+
run: |
119+
u3d available -u ${{ matrix.unity_version }} -p
120+
python scripts/gha/unity_installer.py --install --platforms ${{ matrix.unity_platform_name }} --version ${{ matrix.unity_version }}
121+
122+
- name: Setup Unity path
123+
shell: bash
124+
run: |
125+
echo "UNITY_ROOT_DIR=${{ matrix.unity_install_dir }}" >> $GITHUB_ENV
126+
echo "$(swig -swiglib)" >> $GITHUB_PATH
127+
swig -swiglib
128+
echo "SWIG_DIR=$(swig -swiglib)" >> $GITHUB_ENV
129+
107130
- name: Build SDK (Linux)
108131
if: startsWith(matrix.os, 'ubuntu')
109132
shell: bash
@@ -120,7 +143,19 @@ jobs:
120143
if: startsWith(matrix.os, 'windows')
121144
shell: bash
122145
run: |
123-
./build_windows_x64.bat
146+
# ./build_windows_x64.bat ${{ github.event.inputs.additional_cmake_flags }} TODO convert to python script
147+
mkdir ${{ matrix.build_dir }}
148+
pushd ${{ matrix.build_dir }}
149+
cmake .. -G "Visual Studio 16 2019" -A x64 -DFIREBASE_CPP_SDK_DIR="${FIREBASE_CPP_SDK_DIR}" -DUNITY_ROOT_DIR="${{ matrix.unity_install_dir }}" -DSWIG_DIR="$(swig -swiglib)" ${{ github.event.inputs.additional_cmake_flags }}
150+
echo "=-=-=-=-=-=-=-=-="
151+
echo "Start Build"
152+
echo "=-=-=-=-=-=-=-=-="
153+
cmake --build . --config Release
154+
echo "=-=-=-=-=-=-=-=-="
155+
echo "Start Package"
156+
echo "=-=-=-=-=-=-=-=-="
157+
cpack .
158+
popd
124159
125160
- name: Upload Build
126161
uses: actions/upload-artifact@v2

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,6 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR})
207207
${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information")
208208
endif()
209209

210-
if(MSVC AND NOT EXISTS ${MONO_DIR})
211-
message(FATAL_ERROR "Mono directory doesn't exist: \
212-
${MONO_DIR}. See the readme.md for more information")
213-
endif()
214-
215210
# Add the Firebase libraries to the target using the function from the SDK.
216211
add_subdirectory(${FIREBASE_CPP_SDK_DIR} bin/ EXCLUDE_FROM_ALL)
217212

cmake/external_rules.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ function(download_external_sources)
6262

6363
execute_process(
6464
COMMAND
65-
${ENV_COMMAND} cmake
65+
${ENV_COMMAND} cmake --debug-output
66+
-G ${CMAKE_GENERATOR}
67+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
68+
-DPLATFORM=${PLATFORM}
69+
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
6670
-DCMAKE_INSTALL_PREFIX=${FIREBASE_INSTALL_DIR}
6771
-DFIREBASE_CPP_GIT_REPO=${FIREBASE_CPP_GIT_REPO}
6872
-DFIREBASE_DOWNLOAD_DIR=${FIREBASE_DOWNLOAD_DIR}

cmake/unity_mono.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,14 @@ macro(mono_add_external_library name projpath)
100100
set(absprojpath ${CMAKE_CURRENT_LIST_DIR}/${projpath})
101101
endif()
102102

103+
set(CSHARP_BUILD_EXE "${UNITY_CSHARP_BUILD_EXE}")
104+
if(MSVC)
105+
set(CSHARP_BUILD_EXE "${MONO_CSHARP_BUILD_EXE}")
106+
endif()
107+
103108
add_custom_command(
104109
COMMAND
105-
${UNITY_CSHARP_BUILD_EXE}
110+
${CSHARP_BUILD_EXE}
106111
/p:AllowUnsafeBlocks=true
107112
/p:Configuration=Release
108113
/p:OutDir="${outdir}/"
@@ -116,7 +121,7 @@ macro(mono_add_external_library name projpath)
116121
OUTPUT
117122
${outdir}/${DLL_NAME}.dll
118123
COMMENT
119-
"Building csproj for ${DLL_NAME}.dll"
124+
"Building csproj for ${DLL_NAME}.dll with ${CSHARP_BUILD_EXE}"
120125
)
121126

122127
set_target_properties(${name} PROPERTIES

cmake/unity_pack.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ function(unity_pack_cs name)
156156

157157
string(REPLACE ".dll" "" dllbasename ${dllname})
158158
string(REPLACE ".dll" "" dllbaserename ${dllrename})
159-
160159
# Dll file
161160
install(
162161
FILES "${dllpath}/${dllname}"

scripts/gha/print_matrix_configuration.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
PARAMETERS = {
5353
"integration_tests": {
5454
"matrix": {
55-
"unity_version": ["2019.4.30f1"],
55+
"unity_version": ["2019.4.32f1"],
5656
"android_device": ["android_target", "emulator_target"],
5757
"ios_device": ["ios_target", "simulator_target"],
5858

@@ -62,7 +62,7 @@
6262
},
6363

6464
EXPANDED_KEY: {
65-
"unity_version": ["2020.3.19f1", "2019.4.30f1", "2018.4.36f1", "2017.4.40f1"],
65+
"unity_version": ["2020.3.22f1", "2019.4.32f1", "2018.4.36f1", "2017.4.40f1", "2017.4.10f1"],
6666
"android_device": ["android_target", "android_latest", "emulator_target", "emulator_latest", "emulator_32bit"],
6767
"ios_device": ["ios_min", "ios_target", "ios_latest", "simulator_min", "simulator_target", "simulator_latest"],
6868
}
@@ -79,11 +79,11 @@
7979
# To list avaliable packages, install u3d, and use cmd "u3d available -u $unity_version -p"
8080
# The packages below is valid only if Unity Hub is not installed.
8181
UNITY_PACKAGES = {
82-
"2020.3.19f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": None, "Linux": ["Linux-mono"]},
83-
"2019.4.30f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": None, "Linux": ["Linux-mono"]},
84-
"2019.4.32f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": None, "Linux": ["linux-il2cpp"]},
85-
"2018.4.36f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": None, "Linux": ["Linux"]},
86-
"2017.4.40f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows"], "macOS": None, "Linux": ["Linux"]}
82+
"2020.3.22f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-il2cpp"], "macOS": None, "Linux": ["linux-il2cpp"]},
83+
"2019.4.32f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["windows-il2cpp"], "macOS": None, "Linux": ["linux-il2cpp"]},
84+
"2018.4.36f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-il2cpp"], "macOS": None, "Linux": None},
85+
"2017.4.40f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": None, "macOS": None, "Linux": None},
86+
"2017.4.10f1": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows"], "macOS": None, "Linux": None} # For Linux Special
8787
}
8888

8989
TEST_DEVICES = {

scripts/gha/unity_installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def install_unity(unity_version, platforms):
171171
"--verbose", unity_version,
172172
"-p", package_csv])
173173
# This will list what u3d has installed. For debugging purposes.
174-
run([u3d, "list"])
174+
# run([u3d, "list"]) TODO sort out the crash issue.
175175
logging.info("Finished installing Unity.")
176176

177177

0 commit comments

Comments
 (0)