forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96b712b
commit 7dbfff2
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Check Symbols | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build"] | ||
types: [completed] | ||
|
||
jobs: | ||
check: | ||
if: ${{ 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 | ||
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 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", | ||
"Some symbols are invalid", | ||
"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
); | ||
} |