-
Notifications
You must be signed in to change notification settings - Fork 1
196 lines (196 loc) · 7.44 KB
/
channels-ci.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
name: Web App CI
on:
pull_request:
push:
branches:
- master
- mono-repo*
defaults:
run:
shell: bash
jobs:
check-lint:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: webapp
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
id: setup_node
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: 'webapp/package-lock.json'
# - uses: actions/cache@2b8105bdae4b746666ee225970c4a281bbd9d51f # v3.2.4
# id: npm-cache
# with:
# path: |
# '**/node_modules'
# 'e2e/playwright/node_modules'
# 'e2e/cypress/node_modules'
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('e2e/cypress/package-lock.json') }}-${{ hashFiles('e2e/playwright/package-lock.json') }}
- name: ci/get-node-modules
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: |
make node_modules
# make channels/e2e/playwright/node_modules
- name: ci/lint
working-directory: webapp/channels
run: |
npm run check
check-i18n:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: webapp
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
id: setup_node
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: 'webapp/package-lock.json'
# - uses: actions/cache@2b8105bdae4b746666ee225970c4a281bbd9d51f # v3.2.4
# id: npm-cache
# with:
# path: |
# '**/node_modules'
# 'e2e/playwright/node_modules'
# 'e2e/cypress/node_modules'
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('e2e/cypress/package-lock.json') }}-${{ hashFiles('e2e/playwright/package-lock.json') }}
- name: ci/get-node-modules
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: |
make node_modules
# make channels/e2e/playwright/node_modules
- name: ci/lint
working-directory: webapp/channels
run: |
cp src/i18n/en.json /tmp/en.json
mkdir -p /tmp/fake-mobile-dir/assets/base/i18n/
echo '{}' > /tmp/fake-mobile-dir/assets/base/i18n/en.json
npm run mmjstool -- i18n extract-webapp --webapp-dir ./src --mobile-dir /tmp/fake-mobile-dir
diff /tmp/en.json src/i18n/en.json
# Address weblate behavior which does not remove whole translation item when translation string is set to empty
npm run mmjstool -- i18n clean-empty --webapp-dir ./src --mobile-dir /tmp/fake-mobile-dir --check
npm run mmjstool -- i18n check-empty-src --webapp-dir ./src --mobile-dir /tmp/fake-mobile-dir
rm -rf tmp
check-type:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: webapp
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
id: setup_node
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: 'webapp/package-lock.json'
# - uses: actions/cache@2b8105bdae4b746666ee225970c4a281bbd9d51f # v3.2.4
# id: npm-cache
# with:
# path: |
# '**/node_modules'
# 'e2e/playwright/node_modules'
# 'e2e/cypress/node_modules'
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('e2e/cypress/package-lock.json') }}-${{ hashFiles('e2e/playwright/package-lock.json') }}
- name: ci/get-node-modules
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: |
make node_modules
# make channels/e2e/playwright/node_modules
- name: ci/lint
working-directory: webapp/channels
run: |
npm run check-types
tests:
runs-on: ubuntu-22.04
needs: [check-type, check-i18n, check-lint]
permissions:
checks: write
pull-requests: write
defaults:
run:
working-directory: webapp
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
id: setup_node
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: 'webapp/package-lock.json'
# - uses: actions/cache@2b8105bdae4b746666ee225970c4a281bbd9d51f # v3.2.4
# id: npm-cache
# with:
# path: |
# '**/node_modules'
# 'e2e/playwright/node_modules'
# 'e2e/cypress/node_modules'
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('e2e/cypress/package-lock.json') }}-${{ hashFiles('e2e/playwright/package-lock.json') }}
- name: ci/get-node-modules
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: |
make node_modules
# make channels/e2e/playwright/node_modules
- name: ci/detect-cpu-core
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@c508d404ab007faae80a014072fd8c0e17792118 # v1.1.0
- name: ci/test
working-directory: webapp/channels
run: |
npm run test-ci -- --maxWorkers=${{ steps.cpu-cores.outputs.count }}
- name: ci/publish-test-results
uses: EnricoMi/publish-unit-test-result-action@a3caf02865c0604ad3dc1ecfcc5cdec9c41b7936 # v2.3.0
if: always()
with:
junit_files: "webapp/channels/build/**/*.xml"
comment_mode: always
compare_to_earlier_commit: false
build:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: webapp
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
id: setup_node
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: 'webapp/package-lock.json'
# - uses: actions/cache@2b8105bdae4b746666ee225970c4a281bbd9d51f # v3.2.4
# id: npm-cache
# with:
# path: |
# '**/node_modules'
# 'e2e/playwright/node_modules'
# 'e2e/cypress/node_modules'
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('e2e/cypress/package-lock.json') }}-${{ hashFiles('e2e/playwright/package-lock.json') }}
- name: ci/get-node-modules
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: |
make node_modules
# make channels/e2e/playwright/node_modules
- name: ci/build
working-directory: webapp/channels
run: |
npm run build
# run-performance-bechmarks:
# uses: ./.github/workflows/performance-benchmarks.yml
# needs: build