Skip to content

Commit 4b1d816

Browse files
committed
[ci] Add CI workflows
1 parent f6c9c2d commit 4b1d816

File tree

5 files changed

+302
-0
lines changed

5 files changed

+302
-0
lines changed

.github/workflows/analyze.yml

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

.github/workflows/build-docker.yml

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

.github/workflows/build.yml

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

Lines changed: 9 additions & 0 deletions
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)