|
1 | 1 | name: Integration tests
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - schedule: |
5 |
| - - cron: "0 9 * * *" # 9am UTC = 1am PST / 2am PDT |
6 |
| - |
7 |
| - pull_request: |
8 |
| - types: [ labeled, closed ] |
9 | 4 |
|
10 | 5 | workflow_dispatch:
|
11 | 6 | inputs:
|
@@ -75,66 +70,53 @@ jobs:
|
75 | 70 | ### trigger value: manual_trigger, scheduled_trigger, label_trigger, postsubmit_trigger
|
76 | 71 | - id: set_outputs
|
77 | 72 | run: |
|
78 |
| - if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then |
79 |
| - if [[ "${{ github.event.inputs.test_pull_request }}" != "nightly-packaging" ]]; then |
80 |
| - # Triggered manually |
81 |
| - echo "::set-output name=trigger::manual_trigger" |
82 |
| - if [[ "${{ github.event.inputs.use_expanded_matrix }}" == "1" ]]; then |
83 |
| - echo "::set-output name=requested_tests::expanded" |
84 |
| - fi |
85 |
| - if [[ -z "${{github.event.inputs.test_pull_request}}" ]]; then |
86 |
| - # test_pull_request not specified |
87 |
| - echo "::set-output name=github_ref::$GITHUB_SHA" |
88 |
| - elif [[ "${{github.event.inputs.test_pull_request}}" == *:* ]]; then |
89 |
| - # If specified as pr:commit_hash, split them. |
90 |
| - echo "::set-output name=github_ref::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f2)" |
91 |
| - echo "::set-output name=pr_number::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)" |
92 |
| - else |
93 |
| - # Just the PR specified, use refs/pull/<number>/merge as the ref. |
94 |
| - echo "::set-output name=github_ref::refs/pull/${{github.event.inputs.test_pull_request}}/merge" |
95 |
| - echo "::set-output name=pr_number::${{ github.event.inputs.test_pull_request }}" |
96 |
| - fi |
97 |
| - elif [[ "${{ github.event.inputs.test_pull_request }}" == "nightly-packaging" ]]; then |
98 |
| - # Triggered by scheduled packaging SDK workflow. |
99 |
| - echo "::set-output name=trigger::scheduled_trigger" |
100 |
| - echo "::set-output name=github_ref::$GITHUB_SHA" |
101 |
| - echo "::set-output name=requested_tests::expanded" |
102 |
| - fi |
103 |
| - elif [[ "${{ github.event_name }}" == "schedule" ]]; then |
| 73 | + if [[ "${{ github.event.inputs.test_pull_request }}" == *"label-quick-packaging" ]]; then |
| 74 | + # Triggered by build_starter SDK workflow. |
| 75 | + echo "::set-output name=trigger::label_trigger" |
| 76 | + echo "::set-output name=requested_tests::auto" |
| 77 | + echo "::set-output name=github_ref::${{github.sha}}" |
| 78 | + echo "::set-output name=pr_number::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)" |
| 79 | + elif [[ "${{ github.event.inputs.test_pull_request }}" == *"label-full-packaging" ]]; then |
| 80 | + # Triggered by build_starter SDK workflow. |
| 81 | + echo "::set-output name=trigger::label_trigger" |
| 82 | + echo "::set-output name=requested_tests::expanded" |
| 83 | + echo "::set-output name=github_ref::${{github.sha}}" |
| 84 | + echo "::set-output name=pr_number::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)" |
| 85 | + elif [[ "${{ github.event.inputs.test_pull_request }}" == *"pr-close-packaging" ]]; then |
| 86 | + # Triggered by build_starter SDK workflow. |
| 87 | + echo "::set-output name=trigger::postsubmit_trigger" |
| 88 | + echo "::set-output name=requested_tests::auto" |
| 89 | + echo "::set-output name=github_ref::${{github.sha}}" |
| 90 | + echo "::set-output name=pr_number::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)" |
| 91 | + elif [[ "${{ github.event.inputs.test_pull_request }}" == "nightly-packaging" ]]; then |
| 92 | + # Triggered by build_starter SDK workflow. |
104 | 93 | echo "::set-output name=trigger::scheduled_trigger"
|
105 |
| - echo "::set-output name=github_ref::$GITHUB_SHA" |
106 | 94 | echo "::set-output name=requested_tests::expanded"
|
107 |
| - elif [[ "${{ github.event_name }}" == "pull_request" ]]; then |
108 |
| - echo "::set-output name=github_ref::$GITHUB_SHA" |
109 |
| - if [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" == "${{ env.triggerLabelPrefix }}"* ]]; then |
110 |
| - echo "::set-output name=trigger::label_trigger" |
111 |
| - echo "::set-output name=pr_number::${{ github.event.pull_request.number }}" |
112 |
| - if [[ "${{ github.event.label.name }}" == "${{ env.triggerLabelQuick }}" ]]; then |
113 |
| - echo "::set-output name=requested_tests::auto" |
114 |
| - else |
115 |
| - echo "::set-output name=requested_tests::expanded" |
116 |
| - fi |
117 |
| - elif [[ "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged == true}}" == "true" ]]; then |
118 |
| - echo "::set-output name=trigger::postsubmit_trigger" |
119 |
| - echo "::set-output name=pr_number::${{ github.event.pull_request.number }}" |
120 |
| - echo "::set-output name=requested_tests::auto" |
| 95 | + echo "::set-output name=github_ref::${{github.sha}}" |
| 96 | + elif [[ "${{ github.event.inputs.test_pull_request }}" == "1" ]]; then |
| 97 | + # Triggered by build_starter SDK workflow. |
| 98 | + echo "::set-output name=trigger::manual_trigger" |
| 99 | + echo "::set-output name=requested_tests::auto" |
| 100 | + echo "::set-output name=github_ref::${{github.sha}}" |
| 101 | + else |
| 102 | + # Triggered manually |
| 103 | + echo "::set-output name=trigger::manual_trigger" |
| 104 | + if [[ "${{ github.event.inputs.use_expanded_matrix }}" == "1" ]]; then |
| 105 | + echo "::set-output name=requested_tests::expanded" |
| 106 | + fi |
| 107 | + if [[ -z "${{github.event.inputs.test_pull_request}}" ]]; then |
| 108 | + # test_pull_request not specified |
| 109 | + echo "::set-output name=github_ref::${{github.sha}}" |
| 110 | + elif [[ "${{github.event.inputs.test_pull_request}}" == *:* ]]; then |
| 111 | + # If specified as pr:commit_hash, split them. |
| 112 | + echo "::set-output name=github_ref::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f2)" |
| 113 | + echo "::set-output name=pr_number::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)" |
| 114 | + else |
| 115 | + # Just the PR specified, use refs/pull/<number>/merge as the ref. |
| 116 | + echo "::set-output name=github_ref::refs/pull/${{github.event.inputs.test_pull_request}}/merge" |
| 117 | + echo "::set-output name=pr_number::${{ github.event.inputs.test_pull_request }}" |
121 | 118 | fi
|
122 | 119 | fi
|
123 |
| - ### If it's not a defined trigger, cancel workflow |
124 |
| - ### e.g. Triggered by non-"test-request" label; triggered by not merged PR close event. |
125 |
| - - name: Cancel workflow |
126 |
| - if: ${{ !steps.set_outputs.outputs.trigger }} |
127 |
| - |
128 |
| - - name: Wait for workflow cancellation |
129 |
| - if: ${{ !steps.set_outputs.outputs.trigger }} |
130 |
| - run: | |
131 |
| - sleep 300 |
132 |
| - exit 1 # fail out if the cancellation above somehow failed. |
133 |
| - - name: Cancel previous runs on the same PR |
134 |
| - if: steps.set_outputs.outputs.trigger == 'label_trigger' |
135 |
| - |
136 |
| - with: |
137 |
| - access_token: ${{ github.token }} |
138 | 120 | - uses: actions/checkout@v2
|
139 | 121 | with:
|
140 | 122 | ref: ${{steps.set_outputs.outputs.github_ref}}
|
@@ -262,7 +244,7 @@ jobs:
|
262 | 244 | workflow: 'build_starter.yml'
|
263 | 245 | run_id: ${{ github.event.inputs.packaged_sdk_run_id }}
|
264 | 246 | - name: Build integration tests
|
265 |
| - timeout-minutes: 180 |
| 247 | + timeout-minutes: 240 |
266 | 248 | shell: bash
|
267 | 249 | run: |
|
268 | 250 | unzip -q firebase_unity_sdk.zip -d ~/Downloads/
|
|
0 commit comments