|
| 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: commit status |
| 20 | + uses: actions/github-script@v5 |
| 21 | + with: |
| 22 | + script: | |
| 23 | + for (const pr of context.payload.workflow_run.pull_requests) { |
| 24 | + if (pr.base.repo.url == context.payload.repository.url) { |
| 25 | + github.rest.repos.createCommitStatus({ |
| 26 | + owner: context.repo.owner, |
| 27 | + repo: context.repo.repo, |
| 28 | + sha: pr.head.sha, |
| 29 | + context: 'Check Symbols', |
| 30 | + state: 'pending', |
| 31 | + description: 'Waiting for build finish' |
| 32 | + }); |
| 33 | + } |
| 34 | + } |
| 35 | +
|
| 36 | + check: |
| 37 | + if: | |
| 38 | + github.event.action == 'completed' && |
| 39 | + github.event.workflow_run.conclusion == 'success' && |
| 40 | + github.event.workflow_run.event == 'pull_request' |
| 41 | +
|
| 42 | + runs-on: ubuntu-latest |
| 43 | + |
| 44 | + steps: |
| 45 | + - name: Dump GitHub context |
| 46 | + env: |
| 47 | + GITHUB_CONTEXT: ${{ toJSON(github) }} |
| 48 | + run: echo "$GITHUB_CONTEXT" |
| 49 | + |
| 50 | + - uses: actions/checkout@v2 |
| 51 | + - uses: actions/checkout@v2 |
| 52 | + with: |
| 53 | + repository: flutter-tizen/tizen_allowlist |
| 54 | + token: ${{ secrets.MY_PAT }} |
| 55 | + path: tizen_allowlist |
| 56 | + |
| 57 | + - name: download artifacts |
| 58 | + uses: TizenAPI/tizenfx-build-actions/download-workflow-artifacts@master |
| 59 | + with: |
| 60 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + run-id: ${{ github.event.workflow_run.id }} |
| 62 | + name: tizen-arm-release |
| 63 | + path: artifacts |
| 64 | + |
| 65 | + - name: check symbols |
| 66 | + id: check |
| 67 | + env: |
| 68 | + ALLOWLIST: tizen_allowlist/4.0.0_native_whitelist_wearable_v12.txt |
| 69 | + run: | |
| 70 | + python ci/docker/tizen/tools/check-symbol.py --allowlist=$ALLOWLIST \ |
| 71 | + artifacts/libflutter_engine.so \ |
| 72 | + artifacts/libflutter_tizen_wearable.so |
| 73 | +
|
| 74 | + - name: commit success status |
| 75 | + if: ${{ success() }} |
| 76 | + uses: actions/github-script@v5 |
| 77 | + with: |
| 78 | + script: | |
| 79 | + for (const pr of context.payload.workflow_run.pull_requests) { |
| 80 | + if (pr.base.repo.url == context.payload.repository.url) { |
| 81 | + github.rest.repos.createCommitStatus({ |
| 82 | + owner: context.repo.owner, |
| 83 | + repo: context.repo.repo, |
| 84 | + sha: pr.head.sha, |
| 85 | + context: "Check Symbols", |
| 86 | + state: 'success', |
| 87 | + description: 'All symbols are valid' |
| 88 | + }); |
| 89 | + } |
| 90 | + } |
| 91 | +
|
| 92 | + - name: commit failure status |
| 93 | + if: ${{ success() }} |
| 94 | + uses: actions/github-script@v5 |
| 95 | + with: |
| 96 | + script: | |
| 97 | + for (const pr of context.payload.workflow_run.pull_requests) { |
| 98 | + if (pr.base.repo.url == context.payload.repository.url) { |
| 99 | + github.rest.repos.createCommitStatus({ |
| 100 | + owner: context.repo.owner, |
| 101 | + repo: context.repo.repo, |
| 102 | + sha: pr.head.sha, |
| 103 | + context: "Check Symbols", |
| 104 | + state: 'failure', |
| 105 | + description: 'Failed in checking symbols', |
| 106 | + target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}', |
| 107 | + }); |
| 108 | + } |
| 109 | + } |
0 commit comments