๐Ÿ“ฆ ionic-team / ionic-framework

๐Ÿ“„ stencil-nightly.yml ยท 260 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260# This workflow is intended to run against the `HEAD` of Stencil's primary branch.
# See https://github.com/ionic-team/stencil for contents of the repository
name: 'Stencil Nightly Build'

on:
  schedule:
    # Run every Monday-Friday
    # at 6:00 UTC (6:00 am UTC)
    - cron: '00 06 * * 1-5'
  workflow_dispatch:
    inputs:
      npm_release_tag:
        required: true
        type: string
        description: What version should be pulled from NPM?
        default: nightly

# When pushing a new commit we should
# cancel the previous test run to not
# consume more runners than we need to.
concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: false

jobs:
  build-core-with-stencil-nightly:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - uses: ./.github/workflows/actions/build-core-stencil-prerelease
        with:
          stencil-version: ${{ inputs.npm_release_tag || 'nightly' }}

  test-core-clean-build:
    needs: [build-core-with-stencil-nightly]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - uses: ./.github/workflows/actions/test-core-clean-build

  test-core-lint:
    needs: [build-core-with-stencil-nightly]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - uses: ./.github/workflows/actions/test-core-lint

  test-core-spec:
    needs: [build-core-with-stencil-nightly]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - uses: ./.github/workflows/actions/test-core-spec
        with:
          stencil-version: ${{ inputs.npm_release_tag || 'nightly' }}

  test-core-screenshot:
    strategy:
      # This ensures that all screenshot shard
      # failures are reported so the dev can
      # review everything at once.
      fail-fast: false
      matrix:
        # Divide the tests into n buckets
        # and run those buckets in parallel.
        # To increase the number of shards,
        # add new items to the shard array
        # and change the value of totalShards
        # to be the length of the shard array.
        shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
        totalShards: [20]
    needs: [build-core-with-stencil-nightly]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - uses: ./.github/workflows/actions/test-core-screenshot
        with:
          shard: ${{ matrix.shard }}
          totalShards: ${{ matrix.totalShards }}

  # Screenshots are required to pass
  # in order for the branch to be merge
  # eligible. However, the screenshot tests
  # are run on n runners where n can change
  # over time. The verify-screenshots step allows
  # us to have a required status check for screenshot
  # results without having to manually add each
  # matrix run in the branch protection rules
  # Source: https://github.community/t/status-check-for-a-matrix-jobs/127354
  verify-screenshots:
    if: ${{ always() }}
    needs: test-core-screenshot
    runs-on: ubuntu-latest
    steps:
      - name: Check build matrix status
        if: ${{ needs.test-core-screenshot.result != 'success' }}
        run: exit 1

  build-vue:
    needs: [build-core-with-stencil-nightly]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/build-vue

  build-vue-router:
    needs: [build-vue]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/build-vue-router

  test-vue-e2e:
    strategy:
      fail-fast: false
      matrix:
        apps: [vue3]
    needs: [build-vue, build-vue-router]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/test-vue-e2e
      with:
        app: ${{ matrix.apps }}

  verify-test-vue-e2e:
    if: ${{ always() }}
    needs: test-vue-e2e
    runs-on: ubuntu-latest
    steps:
      - name: Check build matrix status
        if: ${{ needs.test-vue-e2e.result != 'success' }}
        run: exit 1

  build-angular:
    needs: [build-core-with-stencil-nightly]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/build-angular

  build-angular-server:
    needs: [build-core-with-stencil-nightly]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/build-angular-server

  test-angular-e2e:
    strategy:
      fail-fast: false
      matrix:
        apps: [ng16, ng17, ng18, ng19, ng20]
    needs: [build-angular, build-angular-server]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/test-angular-e2e
      with:
        app: ${{ matrix.apps }}

  verify-test-angular-e2e:
    if: ${{ always() }}
    needs: test-angular-e2e
    runs-on: ubuntu-latest
    steps:
      - name: Check build matrix status
        if: ${{ needs.test-angular-e2e.result != 'success' }}
        run: exit 1

  build-react:
    needs: [build-core-with-stencil-nightly]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/build-react

  build-react-router:
    needs: [build-react]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/build-react-router

  test-react-router-e2e:
    strategy:
      fail-fast: false
      matrix:
        apps: [reactrouter5]
    needs: [build-react, build-react-router]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/test-react-router-e2e
      with:
        app: ${{ matrix.apps }}

  verify-test-react-router-e2e:
    if: ${{ always() }}
    needs: test-react-router-e2e
    runs-on: ubuntu-latest
    steps:
      - name: Check build matrix status
        if: ${{ needs.test-react-router-e2e.result != 'success' }}
        run: exit 1

  test-react-e2e:
    strategy:
      fail-fast: false
      matrix:
        apps: [react17, react18, react19]
    needs: [build-react, build-react-router]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - uses: ./.github/workflows/actions/test-react-e2e
      with:
        app: ${{ matrix.apps }}

  verify-test-react-e2e:
    if: ${{ always() }}
    needs: test-react-e2e
    runs-on: ubuntu-latest
    steps:
      - name: Check build matrix status
        if: ${{ needs.test-react-e2e.result != 'success' }}
        run: exit 1

  send-success-messages:
    needs: [test-core-clean-build, test-core-lint, test-core-spec, verify-screenshots, verify-test-vue-e2e, verify-test-angular-e2e, verify-test-react-router-e2e, verify-test-react-e2e]
    runs-on: ubuntu-latest
    if: ${{ !cancelled() && !contains(needs.*.result, 'failure') }}
    steps:
      - name: Notify success on Discord
        run: |
          curl -H "Content-Type:application/json" \
          -d '{"embeds": [{"title": "โœ… Workflow ${{github.workflow}} #${{github.run_number}} finished successfully", "color": 65280, "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}]}' \
          ${{secrets.DISCORD_NOTIFY_WEBHOOK}}
      - name: Notify success on Slack
        run: |
          curl -H "Content-Type:application/json" \
          -d '{"title": "โœ… Workflow ${{github.workflow}} #${{github.run_number}} finished successfully", "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}' \
          ${{secrets.SLACK_NOTIFY_SUCCESS_WEBHOOK}}

  send-failure-messages:
    needs: [test-core-clean-build, test-core-lint, test-core-spec, verify-screenshots, verify-test-vue-e2e, verify-test-angular-e2e, verify-test-react-router-e2e, verify-test-react-e2e]
    runs-on: ubuntu-latest
    if: ${{ !cancelled() && contains(needs.*.result, 'failure') }}
    steps:
      - name: Notify failure on Discord
        run: |
          curl -H "Content-Type:application/json" \
          -d '{"content": "Alerting <@&1347593178580254761>!", "embeds": [{"title": "โŒ Workflow ${{github.workflow}} #${{github.run_number}} failed", "color": 16711680, "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}]}' \
          ${{secrets.DISCORD_NOTIFY_WEBHOOK}}
      - name: Notify failure on Slack
        run: |
          curl -H "Content-Type:application/json" \
          -d '{"title": "โŒ Workflow ${{github.workflow}} #${{github.run_number}} failed", "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}' \
          ${{secrets.SLACK_NOTIFY_FAILURE_WEBHOOK}}