From 8d56c8e6efca536e4155b9e3431b4e82f1a4945e Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Thu, 9 Sep 2021 14:23:03 +0900 Subject: [PATCH] [workflows] Add workflows for buliding and testing --- .github/workflows/build.yml | 79 ++++++++++++++++++++++++++++++++++ .github/workflows/unittest.yml | 52 ++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000000..6ecc4f386ad7f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,79 @@ +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 + triple: armv7l-tizen-linux-gnueabi + - arch: arm64 + triple: aarch64-tizen-linux-gnu + - arch: x86 + triple: i586-tizen-linux-gnueabi + exclude: + - arch: x86 + mode: release + - arch: x86 + mode: profile + + env: + CACHE_PATH: src/out/linux_${{ matrix.mode }}_${{ matrix.arch }} + CACHE_PREFIX: out-build-linux_${{ matrix.mode }}_${{ matrix.arch }} + + steps: + - uses: actions/checkout@v2 + with: + path: src/flutter + + - uses: actions/cache@v2 + with: + path: ${{ env.CACHE_PATH }} + key: ${{ env.CACHE_PREFIX }}-${{ github.sha }} + restore-keys: | + ${{ env.CACHE_PREFIX }}- + + - 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 $CACHE_PATH + build-engine.sh \ + --target-os linux \ + --target-arch ${{ matrix.arch }} \ + --target-triple ${{ matrix.triple }} \ + --runtime-mode ${{ matrix.mode }} + cache-checksum.sh save $CACHE_PATH + + - uses: actions/upload-artifact@v2 + with: + name: tizen-${{ matrix.arch }}-${{ matrix.mode }} + path: src/out/linux_${{ matrix.mode }}_${{ matrix.arch }}/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 diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000000000..4ab008559c7ea --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,52 @@ +name: Unit Tests + +on: + push: + branches: + - 'flutter-*-tizen' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + container: + image: ghcr.io/flutter-tizen/build-engine:latest + credentials: + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + env: + CACHE_PATH: src/out/host_debug + CACHE_PREFIX: out-build-host_debug + + steps: + - uses: actions/checkout@v2 + with: + path: src/flutter + fetch-depth: 0 + + - uses: actions/cache@v2 + with: + path: ${{ env.CACHE_PATH }} + key: ${{ env.CACHE_PREFIX }}-${{ github.sha }} + restore-keys: | + ${{ env.CACHE_PREFIX }}- + + - name: gclient sync + run: | + gclient-prepare-sync.sh --reduce-deps --shallow-sync + gclient sync -v --no-history --shallow + + - name: check format + run: | + src/flutter/ci/format.sh + + - name: build for testing + run: | + cache-checksum.sh restore $CACHE_PATH + build-engine.sh --build-target flutter_tizen_unittests + cache-checksum.sh save $CACHE_PATH + + - name: run unittests + run: | + $CACHE_PATH/flutter_tizen_unittests