-
-
Notifications
You must be signed in to change notification settings - Fork 0
299 lines (258 loc) · 9.85 KB
/
Copy pathbuild.yml
File metadata and controls
299 lines (258 loc) · 9.85 KB
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
ASDF_ODO_VERBOSE: "true"
jobs:
plugin_test:
name: test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install asdf
uses: asdf-vm/actions/setup@v4
with:
asdf_branch: v0.10.2
- name: Install plugin manually
run: |
mkdir -p ~/.asdf/plugins
ln -snf "$(pwd)" ~/.asdf/plugins/odo
- name: Set path to odo config file
run: |
mkdir -p "${HOME}/.config/odo"
cp "$(pwd)/.github/.odo_config.yaml" "${HOME}/.config/odo/config.yaml"
echo "GLOBALODOCONFIG=${HOME}/.config/odo/config.yaml" >> "$GITHUB_ENV"
- name: Install latest odo
run: |
asdf install odo latest
asdf global odo latest
- name: Test odo
run: odo version
plugin_list-all_test:
name: list-all
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install asdf
uses: asdf-vm/actions/setup@v4
with:
asdf_branch: v0.10.2
- name: Install plugin manually
run: |
mkdir -p ~/.asdf/plugins
ln -snf "$(pwd)" ~/.asdf/plugins/odo
- name: Check that list-all does not include a non-installable tag
run: |
ret=$(asdf list-all odo | grep -F "2.0.0-beta-1" || echo pass)
if [[ "$ret" != "pass" ]]; then
echo "ret: $ret"
echo "unexpected version found: 2.0.0-beta-1, which is not installable"
exit 1
fi
plugin_extension_settings_tests:
name: asdf odo settings
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install asdf
uses: asdf-vm/actions/setup@v4
with:
asdf_branch: v0.10.2
- name: Install plugin manually
run: |
mkdir -p ~/.asdf/plugins
ln -snf "$(pwd)" ~/.asdf/plugins/odo
- name: Install latest odo
run: |
asdf install odo latest
asdf global odo latest
- name: Check that 'asdf odo settings which' works correctly even if GLOBALODOCONFIG settings is not set
run: |
unset GLOBALODOCONFIG
ret=$(asdf odo settings which)
if [[ "$ret" != "${HOME}/.config/odo/settings.yaml" ]]; then
echo "ret: $ret"
echo "unexpected output for 'asdf odo settings which'. Expected: ${HOME}/.config/odo/settings.yaml"
exit 1
fi
- name: Check that 'asdf odo settings which' works correctly if GLOBALODOCONFIG settings is set by user
run: |
export GLOBALODOCONFIG=/tmp/config/odo_settings.yaml
ret=$(asdf odo settings which)
if [[ "$ret" != "${GLOBALODOCONFIG}" ]]; then
echo "ret: $ret"
echo "unexpected output for 'asdf odo settings which'. Expected: ${GLOBALODOCONFIG}"
exit 1
fi
- name: Check that 'asdf odo settings reset' does not exit if GLOBALODOCONFIG does not exist
run: |
export GLOBALODOCONFIG=/tmp/404/some.file
asdf odo settings reset || exit 1
if [ -f "${GLOBALODOCONFIG}" ]; then
echo "File should still be inexistent after running 'asdf odo settings reset': ${GLOBALODOCONFIG}"
exit 1
fi
- name: Check that 'asdf odo settings reset' works correctly if GLOBALODOCONFIG settings is set by user
run: |
export GLOBALODOCONFIG=/tmp/config/odo_settings.yaml
mkdir -p "$(dirname "${GLOBALODOCONFIG}")"
cp -vr ./.github/.odo_config.yaml "${GLOBALODOCONFIG}"
(yes || true) | asdf odo settings reset
if [ -f "${GLOBALODOCONFIG}" ]; then
echo "File should have been removed by 'asdf odo settings reset': ${GLOBALODOCONFIG}"
exit 1
fi
- name: Check that 'asdf odo settings reset' works correctly even if GLOBALODOCONFIG settings is not set
run: |
unset GLOBALODOCONFIG
mkdir -p "${HOME}/.config/odo/"
cp -vr ./.github/.odo_config.yaml "${HOME}/.config/odo/settings.yaml"
(yes || true) | asdf odo settings reset
if [ -f "${HOME}/.config/odo/settings.yaml" ]; then
echo "File should have been removed by 'asdf odo settings reset': ${HOME}/.config/odo/settings.yaml"
exit 1
fi
plugin_test_specific_version:
name: Test installing specific version
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
version: ["2.5.1", "3.0.0-rc2", "3.15.0", "ref:nightly"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install asdf
uses: asdf-vm/actions/setup@v4
with:
asdf_branch: v0.10.2
- name: Install plugin manually
run: |
mkdir -p ~/.asdf/plugins
ln -sf "$(pwd)" ~/.asdf/plugins/odo
- name: Set path to odo config file
run: |
mkdir -p "${HOME}/.config/odo"
cp "$(pwd)/.github/.odo_config.yaml" "${HOME}/.config/odo/config.yaml"
echo "GLOBALODOCONFIG=${HOME}/.config/odo/config.yaml" >> "$GITHUB_ENV"
- name: Install odo v${{ matrix.version }}
run: |
asdf install odo ${{ matrix.version }}
asdf global odo ${{ matrix.version }}
- name: Test odo v${{ matrix.version }}
run: |
grepWord="v${{ matrix.version }}"
if [[ "${{ matrix.version }}" == "ref:nightly" ]]; then
grepWord="nightly"
fi
res=$(odo version | grep -F "${grepWord}" || echo false)
if [[ "$res" == "false" ]]; then
version_output=$(odo version 2>&1 || true)
echo "Expected 'odo version' to contain \"${grepWord}\", but got $version_output"
exit 1
fi
plugin_test_git_ref_upstream_repo:
name: Git refs from upstream repo
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
git_ref: [v2, 7618e8f3e4385bdca620e934c0b27d8fcc878099]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install asdf
uses: asdf-vm/actions/setup@v4
with:
asdf_branch: v0.10.2
- name: Install Golang (for installing odo from Git refs)
run: |
asdf plugin-add golang https://github.com/kennyp/asdf-golang.git
asdf install golang 1.19.13
asdf global golang 1.19.13
- name: Install plugin manually
run: |
mkdir -p ~/.asdf/plugins
ln -sf "$(pwd)" ~/.asdf/plugins/odo
- name: Set path to odo config file
run: |
mkdir -p "${HOME}/.config/odo"
cp "$(pwd)/.github/.odo_config.yaml" "${HOME}/.config/odo/config.yaml"
echo "GLOBALODOCONFIG=${HOME}/.config/odo/config.yaml" >> "$GITHUB_ENV"
- name: Install odo using Git ref (${{ matrix.git_ref }}) from upstream repo
env:
GIT_REF: ${{ matrix.git_ref }}
run: |
asdf install odo ref:"$GIT_REF"
asdf global odo ref:"$GIT_REF"
- name: Test odo using Git ref (${{ matrix.git_ref }}) from upstream repo
env:
GIT_REF: ${{ matrix.git_ref }}
run: |
res=$(odo version | grep -F "($GIT_REF)" || echo false)
if [[ "$res" == "false" ]]; then
version_output=$(odo version 2>&1 || true)
echo "Expected 'odo version' to contain \"($GIT_REF)\", but got $version_output"
exit 1
fi
plugin_test_git_ref_fork_repo:
name: Git refs from fork
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
git_ref: [docs-getting-started-order, 2c6c9f1a418c6620026a1d9908f268083a706e35]
runs-on: ${{ matrix.os }}
env:
ASDF_GITHUB_REPO_FOR_ODO: "https://github.com/rm3l/odo"
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install asdf
uses: asdf-vm/actions/setup@v4
with:
asdf_branch: v0.10.2
- name: Install Golang (for installing odo from Git refs)
run: |
asdf plugin-add golang https://github.com/kennyp/asdf-golang.git
asdf install golang 1.19.13
asdf global golang 1.19.13
- name: Install plugin manually
run: |
mkdir -p ~/.asdf/plugins
ln -sf "$(pwd)" ~/.asdf/plugins/odo
- name: Set path to odo config file
run: |
mkdir -p "${HOME}/.config/odo"
cp "$(pwd)/.github/.odo_config.yaml" "${HOME}/.config/odo/config.yaml"
echo "GLOBALODOCONFIG=${HOME}/.config/odo/config.yaml" >> "$GITHUB_ENV"
- name: Download and install odo using Git ref (${{ matrix.git_ref }}) from fork repo
env:
GIT_REF: ${{ matrix.git_ref }}
run: |
asdf install odo ref:"$GIT_REF"
asdf global odo ref:"$GIT_REF"
- name: Test odo using Git ref (${{ matrix.git_ref }}) from fork repo
env:
GIT_REF: ${{ matrix.git_ref }}
run: |
res=$(odo version | grep -F "(${GIT_REF}@${ASDF_GITHUB_REPO_FOR_ODO})" || echo false)
if [[ "$res" == "false" ]]; then
version_output=$(odo version 2>&1 || true)
echo "Expected 'odo version' to contain \"(${GIT_REF}@${ASDF_GITHUB_REPO_FOR_ODO})\", but got $version_output"
exit 1
fi