Skip to content

Commit c8a9118

Browse files
authored
[ci] Add gen_snapshot artifacts (#227)
* [ci] Add gen_snapshot artifacts * Remove printing environment values * Apply shallow gclient sync * Apply cache to macos-build job
1 parent 87fab19 commit c8a9118

File tree

3 files changed

+126
-6
lines changed

3 files changed

+126
-6
lines changed

.github/workflows/build.yml

Lines changed: 120 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,13 @@ jobs:
8181
if: matrix.os == 'host'
8282
with:
8383
name: host-${{ matrix.arch }}-${{ matrix.mode }}
84-
path: |
85-
src/out/${{ env.OUTPUT_NAME }}/*_unittests
84+
path: src/out/${{ env.OUTPUT_NAME }}/*_unittests
8685

8786
- uses: actions/upload-artifact@v2
8887
if: matrix.os == 'linux'
8988
with:
9089
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}
91-
path: |
92-
src/out/${{ env.OUTPUT_NAME }}/libflutter_*.so
90+
path: src/out/${{ env.OUTPUT_NAME }}/libflutter_*.so
9391

9492
- uses: actions/upload-artifact@v2
9593
if: matrix.arch == 'arm' && matrix.mode == 'release'
@@ -101,6 +99,124 @@ jobs:
10199
src/out/linux_release_arm/cpp_client_wrapper
102100
!src/out/linux_release_arm/cpp_client_wrapper/engine_method_result.cc
103101
102+
- uses: actions/upload-artifact@v2
103+
if: (matrix.arch == 'arm' || matrix.arch == 'arm64') && (matrix.mode == 'release' || matrix.mode == 'profile')
104+
with:
105+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_linux-x64
106+
path: src/out/${{ env.OUTPUT_NAME }}/clang_x64/gen_snapshot
107+
108+
windows-build:
109+
runs-on: windows-2019
110+
111+
strategy:
112+
matrix:
113+
arch: [arm, arm64]
114+
mode: [release, profile]
115+
116+
steps:
117+
- name: checkout engine
118+
run: |
119+
mkdir C:\workspace\engine\src\flutter
120+
cd C:\workspace\engine\src\flutter
121+
git config --global core.autocrlf true
122+
git init --quiet
123+
git remote add origin https://github.com/${{ github.repository }}
124+
git fetch --depth 1 origin ${{ github.sha }}
125+
git checkout FETCH_HEAD
126+
127+
- name: setup environments
128+
run: |
129+
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -Force
130+
echo "DEPOT_TOOLS_WIN_TOOLCHAIN=0" >> $Env:GITHUB_ENV
131+
echo "GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" >> $Env:GITHUB_ENV
132+
echo "WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10" >> $Env:GITHUB_ENV
133+
134+
- name: install depot_tools
135+
run: |
136+
Invoke-WebRequest -Uri https://storage.googleapis.com/chrome-infra/depot_tools.zip -OutFile depot_tools.zip
137+
7z x -y -o"C:\workspace\depot_tools" .\depot_tools.zip
138+
echo "C:\workspace\depot_tools" >> $Env:GITHUB_PATH
139+
140+
- name: gclient sync
141+
working-directory: C:\workspace\engine
142+
run: |
143+
gclient config --name=src\flutter --unmanaged https://github.com/flutter-tizen/engine
144+
$env:PYTHONPATH="C:\workspace\depot_tools"
145+
python3 src\flutter\ci\tizen\gclient-shallow-sync.py src\flutter\DEPS
146+
gclient sync -v --no-history --shallow
147+
148+
- name: build
149+
working-directory: C:\workspace\engine\src
150+
run: |
151+
python3 .\flutter\tools\gn `
152+
--linux --linux-cpu=${{ matrix.arch }} `
153+
--runtime-mode=${{ matrix.mode }} `
154+
--no-goma
155+
ninja -C .\out\linux_${{ matrix.mode }}_${{ matrix.arch }} gen_snapshot
156+
157+
- uses: actions/upload-artifact@v2
158+
with:
159+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_windows-x64
160+
path: C:\workspace\engine\src\out\linux_${{ matrix.mode }}_${{ matrix.arch }}\gen_snapshot.exe
161+
162+
macos-build:
163+
runs-on: macos-11
164+
165+
strategy:
166+
matrix:
167+
arch: [arm, arm64]
168+
mode: [release, profile]
169+
170+
env:
171+
OUTPUT_NAME: linux_${{ matrix.mode }}_${{ matrix.arch }}
172+
173+
steps:
174+
- uses: actions/checkout@v2
175+
with:
176+
path: src/flutter
177+
178+
- uses: actions/cache@v2
179+
with:
180+
path: src/out/${{ env.OUTPUT_NAME }}
181+
key: out-macos-build-${{ env.OUTPUT_NAME }}-${{ github.sha }}
182+
restore-keys: |
183+
out-macos-build-${{ env.OUTPUT_NAME }}-
184+
185+
- name: install depot_tools
186+
run: |
187+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
188+
echo "$PWD/depot_tools" >> $GITHUB_PATH
189+
190+
- name: install required packages
191+
run: |
192+
brew install md5sha1sum
193+
194+
- name: gclient sync
195+
run: |
196+
gclient config --name=src/flutter --unmanaged https://github.com/flutter-tizen/engine
197+
gclient setdep --var=download_android_deps=False --deps-file=src/flutter/DEPS
198+
PYTHONPATH="$PWD/depot_tools" python3 ./src/flutter/ci/tizen/gclient-shallow-sync.py src/flutter/DEPS
199+
gclient sync -v --no-history --shallow
200+
201+
- name: build
202+
run: |
203+
src/flutter/ci/tizen/cache-checksum.sh restore src/out/$OUTPUT_NAME
204+
# Change host_toolchain to mac/clang_x64.
205+
sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" src/build/config/BUILDCONFIG.gn
206+
# Pass dummy toolchain values to avoid using linux target toolchain settings.
207+
python3 ./src/flutter/tools/gn \
208+
--linux --linux-cpu=${{ matrix.arch }} \
209+
--runtime-mode=${{ matrix.mode }} \
210+
--no-goma \
211+
--target-toolchain _ --target-sysroot _ --target-triple _
212+
ninja -C ./src/out/$OUTPUT_NAME clang_x64/gen_snapshot
213+
src/flutter/ci/tizen/cache-checksum.sh save src/out/$OUTPUT_NAME
214+
215+
- uses: actions/upload-artifact@v2
216+
with:
217+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-x64
218+
path: src/out/linux_${{ matrix.mode }}_${{ matrix.arch }}/clang_x64/gen_snapshot
219+
104220
test:
105221
needs: build
106222
runs-on: ubuntu-latest

ci/tizen/cache-checksum.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if [[ "$COMMAND" == "restore" ]]; then
4141

4242
# Set mtime of files in $TARGET_DIRS to OLD time.
4343
for d in $(find $TARGET_DIRS -type d); do
44-
touch -c -m -d @1600000000 $d/* &
44+
touch -t 202001010000 $d/* &
4545
done
4646

4747
# Set mtime of changed files to NEW time.

tools/gn

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def to_gn_args(args):
301301
# attributes in release modes till the toolchain is updated.
302302
gn_args['skia_enable_api_available_macro'] = args.runtime_mode != "release"
303303

304-
if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia']:
304+
if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia', 'linux']:
305305
# OpenGL is deprecated on macOS > 10.11.
306306
# This is not necessarily needed but enabling this until we have a way to
307307
# build a macOS metal only shell and a gl only shell.
@@ -390,6 +390,10 @@ def to_gn_args(args):
390390
if args.target_os in ['android'] and gn_args['target_cpu'] in ['x64' , 'arm64']:
391391
gn_args['dart_use_compressed_pointers'] = True
392392

393+
# Don't use the default linux sysroot when buliding for Linux on MacOS
394+
if sys.platform == 'darwin' and args.target_os == 'linux':
395+
gn_args['use_default_linux_sysroot'] = False
396+
393397
return gn_args
394398

395399
def parse_args(args):

0 commit comments

Comments
 (0)