Skip to content

Commit f72b26d

Browse files
WonyoungChoiswift-kim
authored andcommitted
[workflows] Add workflows for buliding and testing (#182)
* [workflows] Add workflow jobs for buliding and testing * [workflow] Add a workflow to check symbols of artifacts * [workflow] remove format checking step * [workflow] remove unnecessary id definition * Remove libflutter_engine.so from host-x64-debug artifact * Use WonyoungChoi/workflow-run-status-action@v1 to simplify check-symbol workflow * Remove committing pending status from check-symbol worklfow
1 parent a08d62d commit f72b26d

File tree

2 files changed

+193
-0
lines changed

2 files changed

+193
-0
lines changed

.github/workflows/build.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- "flutter-*-tizen"
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
container:
13+
image: ghcr.io/flutter-tizen/build-engine:latest
14+
credentials:
15+
username: ${{ github.repository_owner }}
16+
password: ${{ secrets.GITHUB_TOKEN }}
17+
18+
strategy:
19+
matrix:
20+
arch: [arm, arm64, x86]
21+
mode: [debug, release, profile]
22+
include:
23+
- arch: arm
24+
os: linux
25+
triple: armv7l-tizen-linux-gnueabi
26+
- arch: arm64
27+
os: linux
28+
triple: aarch64-tizen-linux-gnu
29+
- arch: x86
30+
os: linux
31+
triple: i586-tizen-linux-gnueabi
32+
- arch: x64
33+
os: host
34+
triple: none
35+
mode: debug
36+
exclude:
37+
- arch: x86
38+
mode: release
39+
- arch: x86
40+
mode: profile
41+
42+
steps:
43+
- name: setup variables for host
44+
if: matrix.os == 'host'
45+
run: |
46+
echo "OUTPUT_NAME=host_${{ matrix.mode }}" >> $GITHUB_ENV
47+
echo "BUILD_TARGET_OPT=--build-target flutter_tizen_unittests" >> $GITHUB_ENV
48+
49+
- name: setup variables for linux
50+
if: matrix.os == 'linux'
51+
run: |
52+
echo "OUTPUT_NAME=linux_${{ matrix.mode }}_${{ matrix.arch }}" >> $GITHUB_ENV
53+
54+
- uses: actions/checkout@v2
55+
with:
56+
path: src/flutter
57+
58+
- uses: actions/cache@v2
59+
with:
60+
path: src/out/${{ env.OUTPUT_NAME }}
61+
key: out-build-${{ env.OUTPUT_NAME }}-${{ github.sha }}
62+
restore-keys: |
63+
out-build-${{ env.OUTPUT_NAME }}-
64+
65+
- name: gclient sync
66+
run: |
67+
gclient-prepare-sync.sh --reduce-deps --shallow-sync
68+
gclient sync -v --no-history --shallow
69+
70+
- name: build
71+
run: |
72+
cache-checksum.sh restore src/out/$OUTPUT_NAME
73+
build-engine.sh \
74+
--target-os ${{ matrix.os }} \
75+
--target-arch ${{ matrix.arch }} \
76+
--target-triple ${{ matrix.triple }} \
77+
--runtime-mode ${{ matrix.mode }} $BUILD_TARGET_OPT
78+
cache-checksum.sh save src/out/$OUTPUT_NAME
79+
80+
- uses: actions/upload-artifact@v2
81+
if: matrix.os == 'host'
82+
with:
83+
name: host-${{ matrix.arch }}-${{ matrix.mode }}
84+
path: |
85+
src/out/${{ env.OUTPUT_NAME }}/*_unittests
86+
87+
- uses: actions/upload-artifact@v2
88+
if: matrix.os == 'linux'
89+
with:
90+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}
91+
path: |
92+
src/out/${{ env.OUTPUT_NAME }}/libflutter_*.so
93+
94+
- uses: actions/upload-artifact@v2
95+
if: matrix.arch == 'arm' && matrix.mode == 'release'
96+
with:
97+
name: tizen-common
98+
path: |
99+
src/out/linux_release_arm/icu
100+
src/out/linux_release_arm/public
101+
src/out/linux_release_arm/cpp_client_wrapper
102+
!src/out/linux_release_arm/cpp_client_wrapper/engine_method_result.cc
103+
104+
test:
105+
needs: build
106+
runs-on: ubuntu-latest
107+
container:
108+
image: ghcr.io/flutter-tizen/build-engine:latest
109+
credentials:
110+
username: ${{ github.repository_owner }}
111+
password: ${{ secrets.GITHUB_TOKEN }}
112+
113+
steps:
114+
- uses: actions/download-artifact@v2
115+
with:
116+
name: host-x64-debug
117+
118+
- name: prepare
119+
run: |
120+
/etc/init.d/dbus start
121+
chmod +x flutter_tizen_unittests
122+
123+
- name: run unittests
124+
run: |
125+
./flutter_tizen_unittests

.github/workflows/check-symbol.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Check Symbols
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Build"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
check:
11+
if: |
12+
github.event.workflow_run.event == 'pull_request' &&
13+
github.event.workflow_run.conclusion == 'success'
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v2
20+
with:
21+
repository: flutter-tizen/tizen_allowlist
22+
token: ${{ secrets.TIZENAPI_TOKEN }}
23+
path: tizen_allowlist
24+
25+
- name: download artifacts
26+
uses: TizenAPI/tizenfx-build-actions/download-workflow-artifacts@master
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
run-id: ${{ github.event.workflow_run.id }}
30+
name: tizen-arm-release
31+
path: artifacts
32+
33+
- name: check symbols
34+
env:
35+
ALLOWLIST: tizen_allowlist/4.0.0_native_whitelist_wearable_v12.txt
36+
run: |
37+
python ci/docker/tizen/tools/check-symbol.py --allowlist=$ALLOWLIST \
38+
artifacts/libflutter_engine.so \
39+
artifacts/libflutter_tizen_wearable.so
40+
41+
- name: commit success status
42+
if: ${{ success() }}
43+
uses: actions/github-script@v5
44+
with:
45+
script: |
46+
github.rest.repos.createCommitStatus({
47+
owner: context.repo.owner,
48+
repo: context.repo.repo,
49+
sha: context.payload.workflow_run.head_sha,
50+
context: "Check Symbols",
51+
state: 'success',
52+
description: 'All symbols are valid'
53+
});
54+
55+
- name: commit failure status
56+
if: ${{ failure() }}
57+
uses: actions/github-script@v5
58+
with:
59+
script: |
60+
github.rest.repos.createCommitStatus({
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
sha: context.payload.workflow_run.head_sha,
64+
context: "Check Symbols",
65+
state: 'failure',
66+
description: 'Failed in checking symbols',
67+
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
68+
});

0 commit comments

Comments
 (0)