|
4 | 4 | push: |
5 | 5 | branches: [master] |
6 | 6 | workflow_dispatch: |
| 7 | + pull_request: |
| 8 | + branches: [master] |
7 | 9 |
|
8 | 10 | jobs: |
9 | | - notify-app: |
| 11 | + tests-on-push: |
| 12 | + if: github.event_name == 'push' |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Dispatch App Build |
| 16 | + run: | |
| 17 | + curl -sS --fail-with-body -X POST \ |
| 18 | + -H "Authorization: token ${{ secrets.AUTOMATION_ACCESS_TOKEN }}" \ |
| 19 | + -H "Accept: application/vnd.github+json" \ |
| 20 | + https://api.github.com/repos/trycourier/mobile-automation-tests/dispatches \ |
| 21 | + -d '{"event_type": "iOS-Flutter", "client_payload": {"sha":"'"${{ github.sha }}"'","ref":"'"${{ github.ref }}"'"}}' |
| 22 | + curl -sS --fail-with-body -X POST \ |
| 23 | + -H "Authorization: token ${{ secrets.AUTOMATION_ACCESS_TOKEN }}" \ |
| 24 | + -H "Accept: application/vnd.github+json" \ |
| 25 | + https://api.github.com/repos/trycourier/mobile-automation-tests/dispatches \ |
| 26 | + -d '{"event_type": "Android-Flutter", "client_payload": {"sha":"'"${{ github.sha }}"'","ref":"'"${{ github.ref }}"'"}}' |
| 27 | +
|
| 28 | + tests-on-pr: |
| 29 | + if: github.event_name == 'pull_request' |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - name: Dispatch App Build |
| 33 | + run: | |
| 34 | + curl -sS --fail-with-body -X POST \ |
| 35 | + -H "Authorization: token ${{ secrets.AUTOMATION_ACCESS_TOKEN }}" \ |
| 36 | + -H "Accept: application/vnd.github+json" \ |
| 37 | + https://api.github.com/repos/trycourier/mobile-automation-tests/dispatches \ |
| 38 | + -d "$(jq -n \ |
| 39 | + --arg et 'iOS-Flutter' \ |
| 40 | + --arg prnum '${{ github.event.pull_request.number }}' \ |
| 41 | + --arg sh '${{ github.event.pull_request.head.sha }}' \ |
| 42 | + '{event_type:$et, client_payload:{pr:$prnum, sha:$sh}}')" |
| 43 | + curl -sS --fail-with-body -X POST \ |
| 44 | + -H "Authorization: token ${{ secrets.AUTOMATION_ACCESS_TOKEN }}" \ |
| 45 | + -H "Accept: application/vnd.github+json" \ |
| 46 | + https://api.github.com/repos/trycourier/mobile-automation-tests/dispatches \ |
| 47 | + -d "$(jq -n \ |
| 48 | + --arg et 'Android-Flutter' \ |
| 49 | + --arg prnum '${{ github.event.pull_request.number }}' \ |
| 50 | + --arg sh '${{ github.event.pull_request.head.sha }}' \ |
| 51 | + '{event_type:$et, client_payload:{pr:$prnum, sha:$sh}}')" |
| 52 | +
|
| 53 | + tests-manual: |
| 54 | + if: github.event_name == 'workflow_dispatch' |
10 | 55 | runs-on: ubuntu-latest |
11 | 56 | steps: |
12 | 57 | - name: Dispatch App Build |
|
15 | 60 | -H "Authorization: token ${{ secrets.AUTOMATION_ACCESS_TOKEN }}" \ |
16 | 61 | -H "Accept: application/vnd.github+json" \ |
17 | 62 | https://api.github.com/repos/trycourier/mobile-automation-tests/dispatches \ |
18 | | - -d '{"event_type": "iOS-Flutter", "client_payload": { "dummy_payload": "some_value_todo_logic" }}' |
| 63 | + -d '{"event_type": "iOS-Flutter", "client_payload": {"sha":"'"${{ github.sha }}"'","ref":"'"${{ github.ref }}"'"}}' |
19 | 64 | curl -X POST \ |
20 | 65 | -H "Authorization: token ${{ secrets.AUTOMATION_ACCESS_TOKEN }}" \ |
21 | 66 | -H "Accept: application/vnd.github+json" \ |
22 | 67 | https://api.github.com/repos/trycourier/mobile-automation-tests/dispatches \ |
23 | | - -d '{"event_type": "Android-Flutter", "client_payload": { "dummy_payload": "some_value_todo_logic" }}' |
| 68 | + -d '{"event_type": "Android-Flutter", "client_payload": {"sha":"'"${{ github.sha }}"'","ref":"'"${{ github.ref }}"'"}}' |
0 commit comments