-
Notifications
You must be signed in to change notification settings - Fork 167
214 lines (179 loc) · 5.68 KB
/
ci-cd.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
name: CI/CD
on:
push:
branches:
- main
- 'v*'
tags:
- '*'
pull_request:
env:
NODE_VERSION: 18
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
package-location:
- 'docs/ember-intl'
- 'docs/my-app'
- 'docs/my-app-with-lazy-loaded-translations'
- 'docs/my-app-with-namespace-from-folders'
- 'docs/my-classic-app'
- 'docs/my-v1-addon'
- 'docs/my-v1-engine'
- 'docs/my-v2-addon'
- 'packages/ember-intl'
- 'tests/ember-intl'
- 'tests/ember-intl-node'
timeout-minutes: 5
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
working-directory: ${{ matrix.package-location }}
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
package-location:
- 'docs/ember-intl'
- 'docs/my-app'
- 'docs/my-app-with-lazy-loaded-translations'
- 'docs/my-app-with-namespace-from-folders'
- 'docs/my-classic-app'
- 'docs/my-v1-addon'
- 'docs/my-v1-engine'
- 'docs/my-v2-addon'
- 'packages/ember-intl'
- 'tests/ember-intl'
- 'tests/ember-intl-node'
timeout-minutes: 5
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test
run: pnpm test
working-directory: ${{ matrix.package-location }}
test-compatibility:
name: Test compatibility
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scenario:
- 'ember-lts-3.28'
- 'ember-lts-4.12'
- 'ember-lts-5.4'
- 'ember-release'
- 'ember-beta'
- 'ember-canary'
- 'embroider-safe'
- 'embroider-optimized'
timeout-minutes: 7
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test
run: pnpm test:ember-compatibility ${{ matrix.scenario }} --- pnpm test
working-directory: 'tests/ember-intl'
test-ember-intl-node-windows:
name: Test (tests/ember-intl-node, Windows)
runs-on: windows-latest
timeout-minutes: 5
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test
run: pnpm test
working-directory: 'tests/ember-intl-node'
deploy-documentation:
name: Deploy documentation
runs-on: ubuntu-latest
needs: [lint, test, test-compatibility, test-ember-intl-node-windows]
timeout-minutes: 5
# Only run on pushes to the main branch or a tag (i.e. ignore pull requests and cron)
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v4
- name: Set a Git user
run: |
# Set a Git user for committing
git config --global user.name "GitHub Actions"
git config --global user.email "actions@users.noreply.github.com"
# Copy the Git Auth from the local config
git config --global "http.https://github.com/.extraheader" \
"$(git config --local --get http.https://github.com/.extraheader)"
- name: Set the version path
# 'main' or 'v1.2.3'
run: echo "ADDON_DOCS_VERSION_PATH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Deploy the latest documentation
if: github.ref == 'refs/heads/main'
run: pnpm release:documentation --activate --verbose
working-directory: 'docs/ember-intl'
env:
# Rebuild the demo application
ADDON_DOCS_UPDATE_LATEST: 'true'
- name: Deploy the tagged documentation
if: startsWith(github.ref, 'refs/tags/')
run: pnpm release:documentation --activate --verbose
working-directory: 'docs/ember-intl'