Skip to content

Commit b54ad05

Browse files
committed
[ci] Add CI workflows
1 parent 80a25c6 commit b54ad05

File tree

5 files changed

+292
-0
lines changed

5 files changed

+292
-0
lines changed

.github/workflows/analyze.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Analyze
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
format:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
path: src
12+
13+
- name: Install depot_tools
14+
run: |
15+
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
16+
echo "$PWD/depot_tools" >> $GITHUB_PATH
17+
18+
- name: Run gclient sync
19+
run: |
20+
pip3 install requests
21+
gclient config --name=src --unmanaged https://github.com/${{ github.repository }}
22+
gclient sync -v --no-history --shallow --nohooks
23+
24+
- name: Verify C/C++ formatting
25+
working-directory: src
26+
run: |
27+
FILES=$(git ls-files -- '*.h' '*.cc' '*.cpp' | grep -v /third_party/)
28+
third_party/clang/bin/clang-format --style=file --dry-run --Werror $FILES
29+
30+
- name: Verify GN formatting
31+
working-directory: src
32+
run: |
33+
FILES=$(git ls-files -- '*.gn' '*.gni')
34+
third_party/gn/gn format --dry-run $FILES

.github/workflows/build-docker.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build Docker
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
testbed:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: docker/login-action@v2
10+
with:
11+
registry: ghcr.io
12+
username: ${{ github.repository_owner }}
13+
password: ${{ secrets.GITHUB_TOKEN }}
14+
- name: Build and push
15+
env:
16+
REPO_URL: http://download.tizen.org/releases/milestone/tizen/unified
17+
BUILD_ID: tizen-unified_20220517.1
18+
IMAGE: tizen-headed-armv7l
19+
run: |
20+
wget -q ${REPO_URL}/${BUILD_ID}/images/standard/${IMAGE}/${BUILD_ID}_${IMAGE}.tar.gz
21+
tar -zxf ${BUILD_ID}_${IMAGE}.tar.gz
22+
mkdir rootfs
23+
sudo mount rootfs.img rootfs
24+
sudo tar -cC rootfs . | docker import - ghcr.io/${{ github.repository_owner }}/${IMAGE}
25+
sudo umount rootfs
26+
docker push ghcr.io/${{ github.repository_owner }}/${IMAGE}:latest

.github/workflows/build.yml

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-22.04
8+
9+
strategy:
10+
matrix:
11+
api-version: [5.5, 6.5]
12+
arch: [arm, arm64, x86]
13+
include:
14+
- arch: arm
15+
triple: arm-linux-gnueabi
16+
- arch: arm64
17+
triple: aarch64-linux-gnu
18+
- arch: x86
19+
triple: i686-linux-gnu
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
path: src
25+
26+
- uses: actions/cache@v3
27+
with:
28+
path: src/sysroot*
29+
key: sysroot-${{ matrix.api-version }}
30+
31+
- name: Install dependencies
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y rpm2cpio cpio binutils-${{ matrix.triple }}
35+
pip3 install requests
36+
37+
- name: Install depot_tools
38+
run: |
39+
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
40+
echo "$PWD/depot_tools" >> $GITHUB_PATH
41+
42+
- name: Run gclient sync
43+
run: |
44+
gclient config --name=src --unmanaged https://github.com/${{ github.repository }}
45+
gclient sync -v --no-history --shallow
46+
47+
- name: Generate Tizen 6.5 sysroot
48+
if: ${{ matrix.api-version == 6.5 }}
49+
run: src/tools/generate_sysroot.py --api-version 6.5 --out src/sysroot-6.5
50+
51+
- name: Build for Tizen 5.5
52+
if: ${{ matrix.api-version == 5.5 }}
53+
run: |
54+
src/tools/gn \
55+
--target-cpu ${{ matrix.arch }} \
56+
--target-toolchain /usr/lib/llvm-14 \
57+
--target-dir build
58+
ninja -C src/out/build
59+
60+
- name: Build for Tizen 6.5
61+
if: ${{ matrix.api-version == 6.5 }}
62+
run: |
63+
src/tools/gn \
64+
--target-cpu ${{ matrix.arch }} \
65+
--target-toolchain /usr/lib/llvm-14 \
66+
--target-sysroot src/sysroot-6.5/${{ matrix.arch }} \
67+
--api-version 6.5 --system-cxx \
68+
--target-dir build
69+
ninja -C src/out/build
70+
71+
- uses: actions/upload-artifact@v3
72+
with:
73+
name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}
74+
path: src/out/build/libflutter_tizen*.so
75+
if-no-files-found: error
76+
77+
- uses: actions/upload-artifact@v3
78+
with:
79+
name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_unittests
80+
path: src/out/build/flutter_tizen_unittests
81+
if-no-files-found: error
82+
83+
- uses: actions/upload-artifact@v3
84+
if: ${{ github.event_name == 'push' }}
85+
with:
86+
name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_symbols
87+
path: src/out/build/so.unstripped/libflutter_tizen*.so
88+
if-no-files-found: error
89+
90+
- uses: actions/upload-artifact@v3
91+
if: ${{ matrix.arch == 'arm' && matrix.api-version == 5.5 }}
92+
with:
93+
name: tizen-common
94+
path: |
95+
src/out/build/cpp_client_wrapper
96+
src/out/build/icu
97+
src/out/build/public
98+
if-no-files-found: error
99+
100+
test:
101+
needs: build
102+
runs-on: ubuntu-latest
103+
104+
steps:
105+
- uses: actions/checkout@v3
106+
107+
- uses: docker/setup-qemu-action@v2
108+
with:
109+
platforms: arm
110+
111+
- uses: docker/login-action@v2
112+
with:
113+
registry: ghcr.io
114+
username: ${{ github.repository_owner }}
115+
password: ${{ secrets.GITHUB_TOKEN }}
116+
117+
- uses: actions/download-artifact@v3
118+
with:
119+
name: tizen-5.5-arm_unittests
120+
121+
- name: Download engine
122+
run: |
123+
python3 tools/download_engine.py
124+
cp engine/arm/libflutter_engine.so .
125+
rm -rf engine
126+
127+
- name: Run tests
128+
run: |
129+
chmod +x flutter_tizen_unittests
130+
docker run --rm -t -v $PWD:/root ghcr.io/flutter-tizen/tizen-headed-armv7l /root/flutter_tizen_unittests
131+
132+
release:
133+
needs: test
134+
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
135+
runs-on: ubuntu-latest
136+
137+
steps:
138+
- uses: actions/checkout@v3
139+
140+
- uses: actions/download-artifact@v3
141+
142+
- name: Create archives
143+
run: |
144+
rm -r *_unittests
145+
for name in tizen-*; do
146+
7z a $name.zip ./$name/*
147+
done
148+
149+
- name: Set variable
150+
run: echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
151+
152+
- uses: softprops/action-gh-release@v1
153+
with:
154+
name: tizen-embedder-${{ env.SHORT_SHA }}
155+
tag_name: ${{ env.SHORT_SHA }}
156+
target_commitish: ${{ github.sha }}
157+
files: tizen-*.zip
158+
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/check-symbols.yml

+65
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-5.5-arm
30+
path: artifacts
31+
32+
- name: Check symbols
33+
run: |
34+
python3 tools/check_symbols.py \
35+
--allowlist=tizen_allowlist/4.0.0_native_whitelist_wearable_v12.txt \
36+
artifacts/libflutter_tizen_wearable.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+
});

DEPS

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ deps = {
88
'src/third_party/libcxxabi': 'https://llvm.googlesource.com/llvm-project/libcxxabi@65a68da0f1b102574db316d326a53735b03a4574',
99
'src/third_party/googletest': 'https://github.com/google/googletest@054a986a8513149e8374fc669a5fe40117ca6b41',
1010
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@63c2197b976931c6472d9dc9574f98ff2ae9408c',
11+
'src/third_party/clang': {
12+
'packages': [
13+
{
14+
'package': 'fuchsia/third_party/clang/linux-amd64',
15+
'version': 'ugk-KfeqO9fhSfhBFRG4Z-56Kr2AQVSEbku9AEUdotYC'
16+
}
17+
],
18+
'dep_type': 'cipd',
19+
},
1120
'src/third_party/gn': {
1221
'packages': [
1322
{

0 commit comments

Comments
 (0)