Skip to content

Commit 2874fe8

Browse files
committed
[Tizen] Add CI related files
1 parent 048e31f commit 2874fe8

File tree

9 files changed

+634
-0
lines changed

9 files changed

+634
-0
lines changed

.github/workflows/build-docker.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build Docker
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
builder:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: docker/setup-buildx-action@v2
11+
- uses: docker/login-action@v2
12+
with:
13+
registry: ghcr.io
14+
username: ${{ github.repository_owner }}
15+
password: ${{ secrets.GITHUB_TOKEN }}
16+
- uses: docker/build-push-action@v3
17+
with:
18+
context: ci/tizen
19+
file: ci/tizen/Dockerfile
20+
push: true
21+
tags: ghcr.io/${{ github.repository_owner }}/build-engine:latest

.github/workflows/build.yml

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
container:
9+
image: ghcr.io/flutter-tizen/build-engine:latest
10+
credentials:
11+
username: ${{ github.repository_owner }}
12+
password: ${{ secrets.GITHUB_TOKEN }}
13+
14+
strategy:
15+
matrix:
16+
arch: [arm, arm64, x86]
17+
mode: [debug, release, profile]
18+
include:
19+
- arch: arm
20+
triple: arm-linux-gnueabi
21+
- arch: arm64
22+
triple: aarch64-linux-gnu
23+
- arch: x86
24+
triple: i686-linux-gnu
25+
exclude:
26+
- arch: x86
27+
mode: release
28+
- arch: x86
29+
mode: profile
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
with:
34+
path: src/flutter
35+
fetch-depth: 0
36+
37+
- uses: actions/cache@v3
38+
with:
39+
path: /tizen_tools/sysroot
40+
key: sysroot
41+
42+
- name: Install depot_tools
43+
run: |
44+
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
45+
echo "$PWD/depot_tools" >> $GITHUB_PATH
46+
47+
- name: Run gclient sync
48+
run: |
49+
gclient config --name=src/flutter --unmanaged https://github.com/flutter-tizen/engine
50+
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --deps-file=src/flutter/DEPS
51+
gclient sync -v --no-history --shallow
52+
53+
- name: Generate sysroot
54+
run: src/flutter/ci/tizen/generate_sysroot.py --out /tizen_tools/sysroot
55+
56+
- name: Build
57+
run: |
58+
src/flutter/tools/gn \
59+
--target-os linux \
60+
--linux-cpu ${{ matrix.arch }} \
61+
--no-goma \
62+
--target-toolchain /tizen_tools/toolchains \
63+
--target-sysroot /tizen_tools/sysroot/${{ matrix.arch }} \
64+
--target-triple ${{ matrix.triple }} \
65+
--runtime-mode ${{ matrix.mode }} \
66+
--enable-fontconfig \
67+
--disable-desktop-embeddings \
68+
--target-dir build
69+
ninja -C src/out/build flutter_engine_library
70+
cp -f src/third_party/icu/flutter/icudtl.dat src/out/build
71+
72+
- name: Build gen_snapshot
73+
if: ${{ matrix.mode != 'debug' }}
74+
run: ninja -C src/out/build clang_x64/gen_snapshot
75+
76+
- uses: actions/upload-artifact@v3
77+
with:
78+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}
79+
path: |
80+
src/out/build/libflutter_engine.so
81+
src/out/build/icudtl.dat
82+
if-no-files-found: error
83+
84+
- uses: actions/upload-artifact@v3
85+
if: ${{ github.event_name == 'push' }}
86+
with:
87+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_symbols
88+
path: src/out/build/so.unstripped/libflutter_engine.so
89+
if-no-files-found: error
90+
91+
- uses: actions/upload-artifact@v3
92+
if: ${{ matrix.mode != 'debug' }}
93+
with:
94+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_linux-x64
95+
path: src/out/build/clang_x64/gen_snapshot
96+
if-no-files-found: error
97+
98+
windows-build:
99+
runs-on: windows-2019
100+
101+
strategy:
102+
matrix:
103+
arch: [arm, arm64]
104+
mode: [release, profile]
105+
106+
steps:
107+
- name: Run git checkout
108+
run: |
109+
mkdir C:\workspace\engine\src\flutter
110+
cd C:\workspace\engine\src\flutter
111+
git config --global core.autocrlf true
112+
git init --quiet
113+
git remote add origin https://github.com/${{ github.repository }}
114+
git fetch --depth 1 origin ${{ github.sha }}
115+
git checkout FETCH_HEAD
116+
117+
- name: Environment setup
118+
run: |
119+
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -Force
120+
echo "DEPOT_TOOLS_WIN_TOOLCHAIN=0" >> $Env:GITHUB_ENV
121+
echo "GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" >> $Env:GITHUB_ENV
122+
echo "WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10" >> $Env:GITHUB_ENV
123+
124+
- name: Install depot_tools
125+
run: |
126+
Invoke-WebRequest -Uri https://storage.googleapis.com/chrome-infra/depot_tools.zip -OutFile depot_tools.zip
127+
7z x -y -o"C:\workspace\depot_tools" .\depot_tools.zip
128+
echo "C:\workspace\depot_tools" >> $Env:GITHUB_PATH
129+
130+
- name: Run gclient sync
131+
working-directory: C:\workspace\engine
132+
run: |
133+
gclient config --name=src\flutter --unmanaged https://github.com/flutter-tizen/engine
134+
gclient setdep --var=download_dart_sdk=False --deps-file=src/flutter/DEPS
135+
gclient sync -v --no-history --shallow
136+
137+
- name: Build
138+
working-directory: C:\workspace\engine\src
139+
run: |
140+
python3 .\flutter\tools\gn `
141+
--linux `
142+
--linux-cpu=${{ matrix.arch }} `
143+
--runtime-mode=${{ matrix.mode }} `
144+
--no-goma `
145+
--target-dir build
146+
ninja -C .\out\build gen_snapshot
147+
148+
- uses: actions/upload-artifact@v3
149+
with:
150+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_windows-x64
151+
path: C:\workspace\engine\src\out\build\gen_snapshot.exe
152+
if-no-files-found: error
153+
154+
macos-build:
155+
runs-on: macos-11
156+
157+
strategy:
158+
matrix:
159+
arch: [arm, arm64]
160+
mode: [release, profile]
161+
162+
steps:
163+
- uses: actions/checkout@v3
164+
with:
165+
path: src/flutter
166+
fetch-depth: 0
167+
168+
- name: Install depot_tools
169+
run: |
170+
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
171+
echo "$PWD/depot_tools" >> $GITHUB_PATH
172+
173+
- name: Run gclient sync
174+
run: |
175+
gclient config --name=src/flutter --unmanaged https://github.com/flutter-tizen/engine
176+
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --deps-file=src/flutter/DEPS
177+
gclient sync -v --no-history --shallow
178+
179+
- name: Build
180+
run: |
181+
# Change host_toolchain to mac/clang_x64.
182+
sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" src/build/config/BUILDCONFIG.gn
183+
184+
# Pass dummy values to prevent using the default (Linux) toolchain.
185+
src/flutter/tools/gn \
186+
--linux \
187+
--linux-cpu=${{ matrix.arch }} \
188+
--no-goma \
189+
--target-toolchain _ \
190+
--target-sysroot _ \
191+
--target-triple _ \
192+
--runtime-mode=${{ matrix.mode }} \
193+
--disable-desktop-embeddings \
194+
--target-dir build
195+
ninja -C src/out/build clang_x64/gen_snapshot
196+
197+
- uses: actions/upload-artifact@v3
198+
with:
199+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-x64
200+
path: src/out/build/clang_x64/gen_snapshot
201+
if-no-files-found: error
202+
203+
release:
204+
needs: [build, windows-build, macos-build]
205+
if: ${{ github.event_name == 'push' }}
206+
runs-on: ubuntu-latest
207+
208+
steps:
209+
- uses: actions/checkout@v3
210+
211+
- uses: actions/download-artifact@v3
212+
213+
- name: Create archives
214+
run: |
215+
for name in tizen-*; do
216+
7z a $name.zip ./$name/*
217+
done
218+
219+
- name: Set variables
220+
run: |
221+
echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
222+
echo "VERSION=$(echo "${{ github.ref_name }}" | cut -d'-' -f2)" >> $GITHUB_ENV
223+
224+
- uses: softprops/action-gh-release@v1
225+
with:
226+
name: ${{ env.VERSION }} (${{ env.SHORT_SHA }})
227+
tag_name: ${{ env.SHORT_SHA }}
228+
target_commitish: ${{ github.sha }}
229+
files: tizen-*.zip
230+
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Check symbols
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Build
7+
types:
8+
- completed
9+
10+
jobs:
11+
check:
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: actions/checkout@v3
19+
with:
20+
repository: flutter-tizen/tizen_allowlist
21+
token: ${{ secrets.TIZENAPI_TOKEN }}
22+
path: tizen_allowlist
23+
24+
- name: Download artifacts
25+
uses: TizenAPI/tizenfx-build-actions/download-workflow-artifacts@master
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
run-id: ${{ github.event.workflow_run.id }}
29+
name: tizen-arm-release
30+
path: artifacts
31+
32+
- name: Check symbols
33+
run: |
34+
python3 ci/tizen/check_symbols.py \
35+
--allowlist=tizen_allowlist/4.0.0_native_whitelist_wearable_v12.txt \
36+
artifacts/libflutter_engine.so
37+
38+
- name: Commit success status
39+
if: ${{ success() }}
40+
uses: actions/github-script@v6
41+
with:
42+
script: |
43+
github.rest.repos.createCommitStatus({
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
sha: context.payload.workflow_run.head_sha,
47+
context: 'Check symbols',
48+
state: 'success',
49+
description: 'All symbols are valid',
50+
});
51+
52+
- name: Commit failure status
53+
if: ${{ failure() }}
54+
uses: actions/github-script@v6
55+
with:
56+
script: |
57+
github.rest.repos.createCommitStatus({
58+
owner: context.repo.owner,
59+
repo: context.repo.repo,
60+
sha: context.payload.workflow_run.head_sha,
61+
context: 'Check symbols',
62+
state: 'failure',
63+
description: 'Failed in checking symbols',
64+
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
65+
});

ci/tizen/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/llvm-project/
2+
/toolchains/
3+
/sysroot/

ci/tizen/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
###############################
2+
### Stage for building LLVM ###
3+
###############################
4+
5+
FROM ubuntu:20.04 AS llvm
6+
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
RUN apt-get update && \
10+
apt-get install -y git zip build-essential cmake ninja-build clang-11 && \
11+
apt-get clean
12+
13+
COPY build_llvm.sh .
14+
15+
RUN /build_llvm.sh
16+
17+
18+
##############################
19+
### Create a release image ###
20+
##############################
21+
22+
FROM ubuntu:20.04
23+
24+
ENV DEBIAN_FRONTEND=noninteractive
25+
26+
RUN apt-get update && \
27+
apt-get install -y binutils-arm-linux-gnueabi binutils-aarch64-linux-gnu binutils-i686-linux-gnu && \
28+
apt-get install -y git curl pkg-config ca-certificates python python3 python3-pip rpm2cpio cpio && \
29+
apt-get clean
30+
31+
# Copy build artifacts from the previous stage.
32+
COPY --from=llvm /toolchains/ /tizen_tools/toolchains/

ci/tizen/arm.patch

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/usr/include/asm-arm/hwcap.h b/usr/include/asm-arm/hwcap.h
2+
index da85060..adaf619 100644
3+
--- a/usr/include/asm-arm/hwcap.h
4+
+++ b/usr/include/asm-arm/hwcap.h
5+
@@ -26,5 +26,10 @@
6+
#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */
7+
#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
8+
9+
+#define HWCAP2_AES (1 << 0)
10+
+#define HWCAP2_PMULL (1 << 1)
11+
+#define HWCAP2_SHA1 (1 << 2)
12+
+#define HWCAP2_SHA2 (1 << 3)
13+
+#define HWCAP2_CRC32 (1 << 4)
14+
15+
#endif /* __ASMARM_HWCAP_H */

0 commit comments

Comments
 (0)