-
Notifications
You must be signed in to change notification settings - Fork 39
228 lines (187 loc) · 5.95 KB
/
web-pinochle-tests.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
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
name: Web Pinochle Tests
on:
pull_request:
branches: [master]
paths:
- 'client/web/pinochle/**'
env:
cwd: client/web/pinochle
name: pinochle
##############################################################
jobs:
tests:
name: Tests
strategy:
matrix:
# os: [ubuntu-latest, macOS-latest, windows-latest]
# browsers: [chrome, firefox, safari, edge]
ci_browser:
- Chrome
- Firefox
# - Safari
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install
working-directory: ${{ env.cwd }}
run: yarn install
- name: Test
working-directory: ${{ env.cwd }}
env:
CI_BROWSER: ${{ matrix.ci_browser }}
# run: ./scripts/test-with-coverage.sh
run: yarn ember test
# Coverage Disabled while these are worked out:
# https://github.com/babel/ember-cli-babel/issues/350
# https://github.com/kategengler/ember-cli-code-coverage/issues/265
#
# - name: Upload Coverage to Coveralls
# uses: coverallsapp/[email protected]
# with:
# github-token: ${{ secrets.github_token }}
# path-to-lcov: ./client/web/emberclear/coverage/lcov.info
# - name: Upload Coverage Artifacts
# uses: actions/upload-artifact@v1
# with:
# name: coverage
# path: client/web/emberclear/coverage/
##############################################################
#
# bundle_analysis:
# name: Bundle Analysis
# runs-on: ubuntu-latest
# timeout-minutes: 15
# steps:
# - uses: actions/checkout@v2
# - uses: volta-cli/action@v1
# - uses: actions/cache@v2
# with:
# path: '**/node_modules'
# key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
# - name: Install
# working-directory: ${{ env.cwd }}
# run: yarn install
# - name: Analyze Bundle
# working-directory: ${{ env.cwd }}
# run: yarn analyze
# - name: Upload Bundle Analysis Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: built_bundle_analysis
# path: client/web/emberclear/public/bundle
build_app:
name: Build App
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install and Build
run: |
( cd ${{ env.cwd }} && yarn install && yarn build:production )
cp ${{ env.cwd }}/config/netlify/_redirects ${{ env.cwd }}/dist
- name: Upload App Artifacts
uses: actions/upload-artifact@v2
with:
name: built_${{ env.name }}
path: ${{ env.cwd }}/dist/
##############################################################
# TODO: scope e2e tests to app
# tests_e2e:
# name: E2E Tests
# runs-on: ubuntu-latest
# timeout-minutes: 15
# needs: [deploy_preview]
# steps:
# - uses: actions/checkout@v2
# - uses: volta-cli/action@v1
# - name: Get Deploy URL
# uses: actions/download-artifact@master
# with:
# name: deploy-url
# path: ./
# - name: Test
# run: |
# export DEPLOY_URL=$(cat ./deploy-url.txt)
# cd client/web/smoke-tests
# DETECT_CHROMEDRIVER_VERSION=true yarn
# yarn test --target pull-request --headless
##############################################################
deploy_preview:
name: Deploy Preview
runs-on: ubuntu-latest
timeout-minutes: 15
needs:
# - bundle_analysis
- build_app
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
# - name: Download Built Bundle Analysis Artifacts
# uses: actions/download-artifact@master
# with:
# name: built_bundle_analysis
# path: ./deploy/bundle-analysis/
- name: Download Built App Artifacts
uses: actions/download-artifact@master
with:
name: built_${{ env.name }}
path: ./deploy/app/
- name: Combine Bundle Analysis with App
run: |
mkdir -p ./deploy/dist/bundle/
mv ./deploy/app/* ./deploy/dist/
cp ${{ env.cwd }}/config/netlify/_redirects ./deploy/dist/
# cp ./deploy/bundle-analysis/* ./deploy/dist/bundle/
- name: Deploy to Netlify
id: deploy
uses: nwtgck/[email protected]
with:
publish-dir: './deploy/dist'
production-branch: __handled_separately__
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID_PINOCHLE }}
- run: echo "${{ steps.deploy.outputs.deploy-url }}" > deploy-url.txt
- name: Upload URL as Artifact
uses: actions/upload-artifact@v2
with:
name: deploy-url
path: deploy-url.txt
##############################################################
# lhci:
# name: Lighthouse CI
# runs-on: ubuntu-latest
# needs: [build_app]
# steps:
# - uses: actions/checkout@v2
# - uses: volta-cli/action@v1
# - name: Download Built App Artifacts
# uses: actions/download-artifact@master
# with:
# name: built_app
# path: ${{ env.cwd }}/dist/
# - name: run Lighthouse
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
# run: |
# volta install node
# volta install @lhci/[email protected]
# cd ${{ env.cwd }}
# lhci collect \
# --upload.target=temporary-public-storage \
# --staticDistDir=./dist \
# --githubToken $GITHUB_TOKEN \
# --githubAppToken $LHCI_GITHUB_APP_TOKEN