diff --git a/.github/workflows/check-symbol.yml b/.github/workflows/check-symbol.yml new file mode 100644 index 0000000000000..edfb54967bc59 --- /dev/null +++ b/.github/workflows/check-symbol.yml @@ -0,0 +1,75 @@ +name: Check Symbols + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + check: + if: | + github.event.action == 'completed' && + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event == 'pull_request' + + runs-on: ubuntu-latest + + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + + - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + with: + repository: flutter-tizen/tizen_allowlist + token: ${{ secrets.MY_PAT }} + path: tizen_allowlist + - uses: TizenAPI/tizenfx-build-actions/download-workflow-artifacts@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + path: artifacts + unzip: false + - name: check symbols + id: check + continue-on-error: true + env: + ALLOWLIST: tizen_allowlist/4.0.0_native_whitelist_wearable_v12.txt + run: | + for f in $(ls -1 artifacts/*.zip); do + unzip -d ${f%.*} $f + done + find artifacts/ -name "libflutter_engine.so" -o -name "libflutter_tizen_wearable.so" | + xargs python ci/docker/tizen/tools/check-symbol.py --allowlist=$ALLOWLIST + - name: commit status + uses: actions/github-script@v5 + with: + script: | + async function commitStatus(state, description, target_url) { + 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: state, + description: description, + target_url: target_url, + }); + } + } + } + if ('${{ steps.check.outcome }}' == 'success') { + commitStatus('success', 'All symbols are valid'); + } + else if ('${{ steps.check.outcome }}' == 'failure') { + commitStatus( + "failure", + "Failed in checking symbols", + "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + ); + }