|
| 1 | +name: Check Symbols |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_run: |
| 5 | + workflows: ["Build"] |
| 6 | + types: |
| 7 | + - requested |
| 8 | + - completed |
| 9 | + |
| 10 | +jobs: |
| 11 | + pending: |
| 12 | + if: | |
| 13 | + github.event.action == 'requested' && |
| 14 | + github.event.workflow_run.event == 'pull_request' |
| 15 | +
|
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Dump GitHub context |
| 20 | + env: |
| 21 | + GITHUB_CONTEXT: ${{ toJSON(github) }} |
| 22 | + run: echo "$GITHUB_CONTEXT" |
| 23 | + |
| 24 | + check: |
| 25 | + if: | |
| 26 | + github.event.action == 'completed' && |
| 27 | + github.event.workflow_run.conclusion == 'success' && |
| 28 | + github.event.workflow_run.event == 'pull_request' |
| 29 | +
|
| 30 | + runs-on: ubuntu-latest |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Dump GitHub context |
| 34 | + env: |
| 35 | + GITHUB_CONTEXT: ${{ toJSON(github) }} |
| 36 | + run: echo "$GITHUB_CONTEXT" |
| 37 | + |
| 38 | + - uses: actions/checkout@v2 |
| 39 | + - uses: actions/checkout@v2 |
| 40 | + with: |
| 41 | + repository: flutter-tizen/tizen_allowlist |
| 42 | + token: ${{ secrets.MY_PAT }} |
| 43 | + path: tizen_allowlist |
| 44 | + - name: download artifacts |
| 45 | + uses: TizenAPI/tizenfx-build-actions/download-workflow-artifacts@master |
| 46 | + with: |
| 47 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + run-id: ${{ github.event.workflow_run.id }} |
| 49 | + name: tizen-arm-release |
| 50 | + path: artifacts |
| 51 | + - name: check symbols |
| 52 | + id: check |
| 53 | + continue-on-error: true |
| 54 | + env: |
| 55 | + ALLOWLIST: tizen_allowlist/4.0.0_native_whitelist_wearable_v12.txt |
| 56 | + run: | |
| 57 | + python ci/docker/tizen/tools/check-symbol.py --allowlist=$ALLOWLIST \ |
| 58 | + artifacts/libflutter_engine.so \ |
| 59 | + artifacts/libflutter_tizen_wearable.so |
| 60 | + - name: commit status |
| 61 | + uses: actions/github-script@v5 |
| 62 | + with: |
| 63 | + script: | |
| 64 | + async function commitStatus(state, description, target_url) { |
| 65 | + for (const pr of context.payload.workflow_run.pull_requests) { |
| 66 | + if (pr.base.repo.url == context.payload.repository.url) { |
| 67 | + github.rest.repos.createCommitStatus({ |
| 68 | + owner: context.repo.owner, |
| 69 | + repo: context.repo.repo, |
| 70 | + sha: pr.head.sha, |
| 71 | + context: "Check Symbols", |
| 72 | + state: state, |
| 73 | + description: description, |
| 74 | + target_url: target_url, |
| 75 | + }); |
| 76 | + } |
| 77 | + } |
| 78 | + } |
| 79 | + if ('${{ steps.check.outcome }}' == 'success') { |
| 80 | + commitStatus('success', 'All symbols are valid'); |
| 81 | + } |
| 82 | + else if ('${{ steps.check.outcome }}' == 'failure') { |
| 83 | + commitStatus( |
| 84 | + "failure", |
| 85 | + "Failed in checking symbols", |
| 86 | + "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
| 87 | + ); |
| 88 | + } |
0 commit comments