From 5fbd26a0742128187700ebcc8c69e41135fd3b1d Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Thu, 9 Sep 2021 14:23:03 +0900 Subject: [PATCH 1/7] [workflows] Add workflow jobs for buliding and testing --- .github/workflows/build.yml | 130 ++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000000..3846ba588e118 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,130 @@ +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 "FETCH_DEPTH=0" >> $GITHUB_ENV + 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 "FETCH_DEPTH=1" >> $GITHUB_ENV + echo "OUTPUT_NAME=linux_${{ matrix.mode }}_${{ matrix.arch }}" >> $GITHUB_ENV + + - uses: actions/checkout@v2 + with: + path: src/flutter + fetch-depth: ${{ env.FETCH_DEPTH }} + + - 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: check format + if: matrix.os == 'host' + run: | + src/flutter/ci/format.sh + + - 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 }}/libflutter_*.so + 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: run unittests + run: | + /etc/init.d/dbus start + chmod +x flutter_tizen_unittests + ./flutter_tizen_unittests From b516089791708cc151d4ec470ff820c4b7b8e75f Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Mon, 27 Sep 2021 18:30:55 +0900 Subject: [PATCH 2/7] [workflow] Add a workflow to check symbols of artifacts --- .github/workflows/check-symbol.yml | 104 +++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/check-symbol.yml diff --git a/.github/workflows/check-symbol.yml b/.github/workflows/check-symbol.yml new file mode 100644 index 0000000000000..aeeae0f9a0327 --- /dev/null +++ b/.github/workflows/check-symbol.yml @@ -0,0 +1,104 @@ +name: Check Symbols + +on: + workflow_run: + workflows: ["Build"] + types: + - requested + - completed + +jobs: + pending: + if: | + github.event.action == 'requested' && + github.event.workflow_run.event == 'pull_request' + + runs-on: ubuntu-latest + + steps: + - name: commit status + uses: actions/github-script@v5 + with: + script: | + for (const pr of context.payload.workflow_run.pull_requests) { + if (pr.base.repo.url == context.payload.repository.url) { + github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: pr.head.sha, + context: 'Check Symbols', + state: 'pending', + description: 'Waiting for build finish' + }); + } + } + + check: + if: | + github.event.action == 'completed' && + 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 + id: check + 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: | + for (const pr of context.payload.workflow_run.pull_requests) { + if (pr.base.repo.url == context.payload.repository.url) { + github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: pr.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: | + for (const pr of context.payload.workflow_run.pull_requests) { + if (pr.base.repo.url == context.payload.repository.url) { + github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: pr.head.sha, + context: "Check Symbols", + state: 'failure', + description: 'Failed in checking symbols', + target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}', + }); + } + } From b7907b53fa4472ebe7ba1f6ea9d3a66d2a5d14ca Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Tue, 28 Sep 2021 15:32:44 +0900 Subject: [PATCH 3/7] [workflow] remove format checking step --- .github/workflows/build.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3846ba588e118..5df81ff1e1d59 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build on: push: branches: - - 'flutter-*-tizen' + - "flutter-*-tizen" pull_request: jobs: @@ -43,20 +43,17 @@ jobs: - name: setup variables for host if: matrix.os == 'host' run: | - echo "FETCH_DEPTH=0" >> $GITHUB_ENV 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 "FETCH_DEPTH=1" >> $GITHUB_ENV echo "OUTPUT_NAME=linux_${{ matrix.mode }}_${{ matrix.arch }}" >> $GITHUB_ENV - uses: actions/checkout@v2 with: path: src/flutter - fetch-depth: ${{ env.FETCH_DEPTH }} - uses: actions/cache@v2 with: @@ -70,11 +67,6 @@ jobs: gclient-prepare-sync.sh --reduce-deps --shallow-sync gclient sync -v --no-history --shallow - - name: check format - if: matrix.os == 'host' - run: | - src/flutter/ci/format.sh - - name: build run: | cache-checksum.sh restore src/out/$OUTPUT_NAME @@ -123,8 +115,11 @@ jobs: with: name: host-x64-debug - - name: run unittests + - name: prepare run: | /etc/init.d/dbus start chmod +x flutter_tizen_unittests + + - name: run unittests + run: | ./flutter_tizen_unittests From 1cb446ef0167507ed600a3a249fecf38efa85e75 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Tue, 28 Sep 2021 15:51:16 +0900 Subject: [PATCH 4/7] [workflow] remove unnecessary id definition --- .github/workflows/check-symbol.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check-symbol.yml b/.github/workflows/check-symbol.yml index aeeae0f9a0327..4ab14f712c844 100644 --- a/.github/workflows/check-symbol.yml +++ b/.github/workflows/check-symbol.yml @@ -58,7 +58,6 @@ jobs: path: artifacts - name: check symbols - id: check env: ALLOWLIST: tizen_allowlist/4.0.0_native_whitelist_wearable_v12.txt run: | From 05b469bc292a28bd3ff1633ac191f16bec0f9aa4 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Wed, 29 Sep 2021 17:25:29 +0900 Subject: [PATCH 5/7] Remove libflutter_engine.so from host-x64-debug artifact --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5df81ff1e1d59..53a2e86d1305f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,14 +82,14 @@ jobs: with: name: host-${{ matrix.arch }}-${{ matrix.mode }} path: | - src/out/${{ env.OUTPUT_NAME }}/libflutter_*.so 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 + path: | + src/out/${{ env.OUTPUT_NAME }}/libflutter_*.so - uses: actions/upload-artifact@v2 if: matrix.arch == 'arm' && matrix.mode == 'release' From b6a35bd16ebdbc096c05f59b18cc217d976fa212 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Thu, 30 Sep 2021 21:20:30 +0900 Subject: [PATCH 6/7] Use WonyoungChoi/workflow-run-status-action@v1 to simplify check-symbol workflow --- .github/workflows/check-symbol.yml | 76 +++++------------------------- 1 file changed, 11 insertions(+), 65 deletions(-) diff --git a/.github/workflows/check-symbol.yml b/.github/workflows/check-symbol.yml index 4ab14f712c844..acf7fbc0af747 100644 --- a/.github/workflows/check-symbol.yml +++ b/.github/workflows/check-symbol.yml @@ -8,48 +8,30 @@ on: - completed jobs: - pending: - if: | - github.event.action == 'requested' && - github.event.workflow_run.event == 'pull_request' + check: + if: ${{ github.event.workflow_run.event == 'pull_request' }} runs-on: ubuntu-latest steps: - - name: commit status - uses: actions/github-script@v5 + - uses: WonyoungChoi/workflow-run-status-action@v1 with: - script: | - for (const pr of context.payload.workflow_run.pull_requests) { - if (pr.base.repo.url == context.payload.repository.url) { - github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: pr.head.sha, - context: 'Check Symbols', - state: 'pending', - description: 'Waiting for build finish' - }); - } - } - - check: - if: | - github.event.action == 'completed' && - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' + context: '${{ github.workflow }}' + message_on_pending: "Waiting for build finish" + message_on_success: "All symbols are valid" - runs-on: ubuntu-latest - - steps: - uses: actions/checkout@v2 + if: ${{ github.event.workflow_run.conclusion == 'success' }} + - uses: actions/checkout@v2 + if: ${{ github.event.workflow_run.conclusion == 'success' }} with: repository: flutter-tizen/tizen_allowlist token: ${{ secrets.TIZENAPI_TOKEN }} path: tizen_allowlist - name: download artifacts + if: ${{ github.event.workflow_run.conclusion == 'success' }} uses: TizenAPI/tizenfx-build-actions/download-workflow-artifacts@master with: token: ${{ secrets.GITHUB_TOKEN }} @@ -58,46 +40,10 @@ jobs: path: artifacts - name: check symbols + if: ${{ github.event.workflow_run.conclusion == 'success' }} 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: | - for (const pr of context.payload.workflow_run.pull_requests) { - if (pr.base.repo.url == context.payload.repository.url) { - github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: pr.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: | - for (const pr of context.payload.workflow_run.pull_requests) { - if (pr.base.repo.url == context.payload.repository.url) { - github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: pr.head.sha, - context: "Check Symbols", - state: 'failure', - description: 'Failed in checking symbols', - target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}', - }); - } - } From 8745e77e8f06895d9d0304aa552bcbc74d4c95bf Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Fri, 1 Oct 2021 13:55:15 +0900 Subject: [PATCH 7/7] Remove committing pending status from check-symbol worklfow --- .github/workflows/check-symbol.yml | 45 +++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check-symbol.yml b/.github/workflows/check-symbol.yml index acf7fbc0af747..73ab0792c1043 100644 --- a/.github/workflows/check-symbol.yml +++ b/.github/workflows/check-symbol.yml @@ -4,34 +4,25 @@ on: workflow_run: workflows: ["Build"] types: - - requested - completed jobs: check: - if: ${{ github.event.workflow_run.event == 'pull_request' }} + if: | + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - - uses: WonyoungChoi/workflow-run-status-action@v1 - with: - context: '${{ github.workflow }}' - message_on_pending: "Waiting for build finish" - message_on_success: "All symbols are valid" - - uses: actions/checkout@v2 - if: ${{ github.event.workflow_run.conclusion == 'success' }} - - uses: actions/checkout@v2 - if: ${{ github.event.workflow_run.conclusion == 'success' }} with: repository: flutter-tizen/tizen_allowlist token: ${{ secrets.TIZENAPI_TOKEN }} path: tizen_allowlist - name: download artifacts - if: ${{ github.event.workflow_run.conclusion == 'success' }} uses: TizenAPI/tizenfx-build-actions/download-workflow-artifacts@master with: token: ${{ secrets.GITHUB_TOKEN }} @@ -40,10 +31,38 @@ jobs: path: artifacts - name: check symbols - if: ${{ github.event.workflow_run.conclusion == 'success' }} 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 }}', + });