Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[workflows] Add workflow jobs for buliding and testing #4

Open
wants to merge 7 commits into
base: flutter-2.2.1-tizen
Choose a base branch
from
125 changes: 125 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Build

on:
push:
branches:
- "flutter-*-tizen"
pull_request:

jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/flutter-tizen/build-engine:latest
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

strategy:
matrix:
arch: [arm, arm64, x86]
mode: [debug, release, profile]
include:
- arch: arm
os: linux
triple: armv7l-tizen-linux-gnueabi
- arch: arm64
os: linux
triple: aarch64-tizen-linux-gnu
- arch: x86
os: linux
triple: i586-tizen-linux-gnueabi
- arch: x64
os: host
triple: none
mode: debug
exclude:
- arch: x86
mode: release
- arch: x86
mode: profile

steps:
- name: setup variables for host
if: matrix.os == 'host'
run: |
echo "OUTPUT_NAME=host_${{ matrix.mode }}" >> $GITHUB_ENV
echo "BUILD_TARGET_OPT=--build-target flutter_tizen_unittests" >> $GITHUB_ENV

- name: setup variables for linux
if: matrix.os == 'linux'
run: |
echo "OUTPUT_NAME=linux_${{ matrix.mode }}_${{ matrix.arch }}" >> $GITHUB_ENV

- uses: actions/checkout@v2
with:
path: src/flutter

- uses: actions/cache@v2
with:
path: src/out/${{ env.OUTPUT_NAME }}
key: out-build-${{ env.OUTPUT_NAME }}-${{ github.sha }}
restore-keys: |
out-build-${{ env.OUTPUT_NAME }}-

- name: gclient sync
run: |
gclient-prepare-sync.sh --reduce-deps --shallow-sync
gclient sync -v --no-history --shallow

- name: build
run: |
cache-checksum.sh restore src/out/$OUTPUT_NAME
build-engine.sh \
--target-os ${{ matrix.os }} \
--target-arch ${{ matrix.arch }} \
--target-triple ${{ matrix.triple }} \
--runtime-mode ${{ matrix.mode }} $BUILD_TARGET_OPT
cache-checksum.sh save src/out/$OUTPUT_NAME

- uses: actions/upload-artifact@v2
if: matrix.os == 'host'
with:
name: host-${{ matrix.arch }}-${{ matrix.mode }}
path: |
src/out/${{ env.OUTPUT_NAME }}/*_unittests

- uses: actions/upload-artifact@v2
if: matrix.os == 'linux'
with:
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}
path: |
src/out/${{ env.OUTPUT_NAME }}/libflutter_*.so

- uses: actions/upload-artifact@v2
if: matrix.arch == 'arm' && matrix.mode == 'release'
with:
name: tizen-common
path: |
src/out/linux_release_arm/icu
src/out/linux_release_arm/public
src/out/linux_release_arm/cpp_client_wrapper
!src/out/linux_release_arm/cpp_client_wrapper/engine_method_result.cc

test:
needs: build
runs-on: ubuntu-latest
container:
image: ghcr.io/flutter-tizen/build-engine:latest
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/download-artifact@v2
with:
name: host-x64-debug

- name: prepare
run: |
/etc/init.d/dbus start
chmod +x flutter_tizen_unittests

- name: run unittests
run: |
./flutter_tizen_unittests
68 changes: 68 additions & 0 deletions .github/workflows/check-symbol.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Check Symbols

on:
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
check:
if: |
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: flutter-tizen/tizen_allowlist
token: ${{ secrets.TIZENAPI_TOKEN }}
path: tizen_allowlist

- name: download artifacts
uses: TizenAPI/tizenfx-build-actions/download-workflow-artifacts@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
name: tizen-arm-release
path: artifacts

- name: check symbols
env:
ALLOWLIST: tizen_allowlist/4.0.0_native_whitelist_wearable_v12.txt
run: |
python ci/docker/tizen/tools/check-symbol.py --allowlist=$ALLOWLIST \
artifacts/libflutter_engine.so \
artifacts/libflutter_tizen_wearable.so

- name: commit success status
if: ${{ success() }}
uses: actions/github-script@v5
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.workflow_run.head_sha,
context: "Check Symbols",
state: 'success',
description: 'All symbols are valid'
});

- name: commit failure status
if: ${{ failure() }}
uses: actions/github-script@v5
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.workflow_run.head_sha,
context: "Check Symbols",
state: 'failure',
description: 'Failed in checking symbols',
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
});