-
Notifications
You must be signed in to change notification settings - Fork 48
178 lines (161 loc) · 5.8 KB
/
prod.yml
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
name: Alloy Prod
on:
schedule:
- cron: "45 20 * * 1-6"
workflow_dispatch:
permissions:
contents: read
issues: read
packages: none
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_CAPABILITIES_OVERRIDES_PATH: "sauceLabsCapabilities.json"
SAUCE_JOB: "Alloy Prod Workflow"
ALLOY_ENV: prod
jobs:
get-testing-tags:
name: Fetch releases
runs-on: ubuntu-latest
outputs:
matrixInput: ${{ steps.list-tags.outputs.matrixInput }}
steps:
- uses: actions/labeler@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
env:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: npm install @octokit/rest semver
- uses: actions/upload-artifact@v3
with:
name: sauce-config
path: .sauce
- uses: actions/upload-artifact@v3
with:
name: sauce-ignore
path: .sauceignore
- name: Retrieve tags
id: list-tags
uses: actions/github-script@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
const getTestingTags = require('./scripts/getTestingTags.js');
const tagsToTest = await getTestingTags();
const matrixInput = { include: tagsToTest.map(tag => ({tag})) }
core.setOutput("matrixInput", JSON.stringify(matrixInput));
console.log("matrixInput: ", matrixInput);
alloy-prod-e2e:
name: Alloy Functional Test
strategy:
max-parallel: 14
matrix: ${{ fromJSON(needs.get-testing-tags.outputs.matrixInput) }}
needs: get-testing-tags
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Create a workflow dispatch event with ${{ matrix.tag }}
uses: actions/checkout@v3
with:
ref: refs/heads/${{ matrix.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Clear cache
uses: actions/cache@v3
id: npm-cache
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset
- name: Store Alloy version into env
uses: nyaa8/package-version@v1
- name: Download sauce config into tags
uses: actions/download-artifact@v3
with:
name: sauce-config
path: .sauce
- name: Remove File
uses: JesseTG/[email protected]
with:
path: .sauceignore
- uses: actions/download-artifact@v3
with:
name: sauce-ignore
path: .
- name: NPM Install
run: npm install
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build
run: npm run test:functional:build:prod
env:
ALLOY_PROD_VERSION: ${{ env.PACKAGE_VERSION }}
- name: Chrome Functional Test
uses: saucelabs/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
sauce-username: ${{ secrets.SAUCE_USERNAME }}
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
env: |
SAUCE_USERNAME=${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY=${{ secrets.SAUCE_ACCESS_KEY }}
ALLOY_PROD_VERSION=${{ env.PACKAGE_VERSION }}
NPM_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
ALLOY_ENV=prod
config-file: ./.sauce/prod.yml
select-suite: "Chrome"
- name: Edge Functional Test
uses: saucelabs/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
sauce-username: ${{ secrets.SAUCE_USERNAME }}
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
env: |
SAUCE_USERNAME=${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY=${{ secrets.SAUCE_ACCESS_KEY }}
ALLOY_PROD_VERSION=${{ env.PACKAGE_VERSION }}
NPM_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
ALLOY_ENV=prod
config-file: ./.sauce/prod.yml
select-suite: "Edge"
- name: Firefox Functional Test
uses: saucelabs/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
sauce-username: ${{ secrets.SAUCE_USERNAME }}
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
env: |
SAUCE_USERNAME=${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY=${{ secrets.SAUCE_ACCESS_KEY }}
ALLOY_PROD_VERSION=${{ env.PACKAGE_VERSION }}
NPM_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
ALLOY_ENV=prod
config-file: ./.sauce/prod.yml
select-suite: "Firefox"
- name: Safari Functional Test
uses: saucelabs/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
sauce-username: ${{ secrets.SAUCE_USERNAME }}
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
env: |
SAUCE_USERNAME=${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY=${{ secrets.SAUCE_ACCESS_KEY }}
ALLOY_PROD_VERSION=${{ env.PACKAGE_VERSION }}
NPM_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
ALLOY_ENV=prod
config-file: ./.sauce/prod.yml
select-suite: "Safari"
- uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
status: failure
if: failure()