@@ -6,7 +6,13 @@ name: Build and test
66# trigger on every commit push and PR for all branches except pushes for backport branches
77on :
88 push :
9- branches : ['main', '[0-9]+\.x', '[0-9]+\.[0-9]+'] # Run the functional test on push for only release branches
9+ branches : ['main', '[0-9]+\.x', '[0-9]+\.[0-9]+', 'fix/chat-basepath-handling', 'feature/chat-file-upload'] # Run the functional test on push for release and feature branches
10+ paths-ignore :
11+ - ' **/*.md'
12+ - ' docs/**'
13+ - ' .lycheeignore'
14+ - ' CODEOWNERS'
15+ - ' changelogs/fragments/**'
1016 pull_request :
1117 branches : ['**']
1218
@@ -29,31 +35,16 @@ jobs:
2935 strategy :
3036 fail-fast : false
3137 matrix :
32- os : [ubuntu-latest, windows-latest ]
38+ os : [ubuntu-latest]
3339 group : [1, 2, 3, 4]
3440 include :
3541 - os : ubuntu-latest
3642 name : Linux
37- - os : windows-latest
38- name : Windows
3943 runs-on : ${{ matrix.os }}
4044 env :
4145 # Override just OSD_OPTIMIZER_MAX_WORKERS for ciGroup1 because it contains a test that checks number of workers
4246 OSD_OPTIMIZER_MAX_WORKERS : ${{ matrix.group != 1 && 8 || '' }}
4347 steps :
44- - name : Configure git's autocrlf (Windows only)
45- if : matrix.os == 'windows-latest'
46- run : |
47- git config --global core.autocrlf false
48-
49- - name : Configure pagefile size (Windows only)
50- if : matrix.os == 'windows-latest'
51- uses : al-cheb/configure-pagefile-action@v1.3
52- with :
53- minimum-size : 16GB
54- maximum-size : 64GB
55- disk-root : ' C:'
56-
5748 - name : Checkout code
5849 uses : actions/checkout@v4
5950
@@ -75,27 +66,20 @@ jobs:
7566 npm i -g yarn@1.22.10
7667 yarn config set network-timeout 1000000 -g
7768
78- - name : Configure Yarn Cache (Linux)
79- if : matrix.os != 'windows-latest'
69+ - name : Configure Yarn Cache
8070 run : echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
8171
8272 - name : Initialize Yarn Cache
8373 uses : actions/cache@v4
84- if : matrix.os != 'windows-latest'
8574 with :
8675 path : ${{ env.YARN_CACHE_LOCATION }}
8776 key : yarn-${{ hashFiles('**/yarn.lock') }}
8877 restore-keys : |
8978 yarn-
9079
91- - name : Run bootstrap (Linux)
92- if : matrix.os != 'windows-latest'
80+ - name : Run bootstrap
9381 run : yarn osd bootstrap
9482
95- - name : Run bootstrap (Windows)
96- if : matrix.os == 'windows-latest'
97- run : yarn osd bootstrap || yarn osd bootstrap
98-
9983 - name : Run unit tests group ${{ matrix.group }} with coverage
10084 id : unit-tests
10185 run : yarn test:jest:ci:coverage --ci-group=${{ matrix.group }}
10892
10993 - name : Upload Code Coverage
11094 id : upload-code-coverage
95+ # Only run in the main repo (secrets not available in forks)
96+ if : github.repository_owner == 'opensearch-project'
11197 uses : codecov/codecov-action@v4
11298 with :
11399 token : ${{ secrets.CODECOV_TOKEN }}
@@ -197,30 +183,15 @@ jobs:
197183 strategy :
198184 fail-fast : false
199185 matrix :
200- os : [ubuntu-latest, windows-latest ]
186+ os : [ubuntu-latest]
201187 group : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
202188 include :
203189 - os : ubuntu-latest
204190 name : Linux
205- - os : windows-latest
206- name : Windows
207191 runs-on : ${{ matrix.os }}
208192 steps :
209193 - run : echo Running functional tests for ciGroup${{ matrix.group }}
210194
211- - name : Configure git's autocrlf (Windows only)
212- if : matrix.os == 'windows-latest'
213- run : |
214- git config --global core.autocrlf false
215-
216- - name : Configure pagefile size (Windows only)
217- if : matrix.os == 'windows-latest'
218- uses : al-cheb/configure-pagefile-action@v1.3
219- with :
220- minimum-size : 16GB
221- maximum-size : 64GB
222- disk-root : ' C:'
223-
224195 - name : Checkout code
225196 uses : actions/checkout@v4
226197
@@ -242,13 +213,11 @@ jobs:
242213 npm i -g yarn@1.22.10
243214 yarn config set network-timeout 1000000 -g
244215
245- - name : Configure Yarn Cache (Linux)
246- if : matrix.os != 'windows-latest'
216+ - name : Configure Yarn Cache
247217 run : echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
248218
249219 - name : Initialize Yarn Cache
250220 uses : actions/cache@v4
251- if : matrix.os != 'windows-latest'
252221 with :
253222 path : ${{ env.YARN_CACHE_LOCATION }}
254223 key : yarn-${{ hashFiles('**/yarn.lock') }}
@@ -264,30 +233,17 @@ jobs:
264233 # v122
265234 version : 1250586
266235
267- - name : Setup Chrome (Linux)
268- if : matrix.os != 'windows-latest'
236+ - name : Setup Chrome
269237 run : |
270238 sudo rm -rf /usr/bin/google-chrome /opt/google/chrome
271239 sudo ln -s ${{steps.download-chrome.outputs.path}}/${{steps.download-chrome.outputs.binary}} /usr/bin/google-chrome
272240
273- - name : Setup Chrome (Windows)
274- if : matrix.os == 'windows-latest'
275- run : |
276- New-Item -Force -Type Directory "$Env:Programfiles/Google/Chrome/Application"
277- Remove-Item -Recurse -Force "$Env:Programfiles/Google/Chrome/Application/*"
278- Copy-Item -Force -Recurse "${{steps.download-chrome.outputs.path}}/*" "$Env:Programfiles/Google/Chrome/Application"
279-
280241 - name : Setup chromedriver
281242 run : node scripts/upgrade_chromedriver.js
282243
283- - name : Run bootstrap (Linux)
284- if : matrix.os != 'windows-latest'
244+ - name : Run bootstrap
285245 run : yarn osd bootstrap
286246
287- - name : Run bootstrap (Windows)
288- if : matrix.os == 'windows-latest'
289- run : yarn osd bootstrap || yarn osd bootstrap
290-
291247 - name : Build plugins
292248 run : node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10
293249
@@ -314,29 +270,14 @@ jobs:
314270 strategy :
315271 fail-fast : false
316272 matrix :
317- os : [ubuntu-latest, windows-latest ]
273+ os : [ubuntu-latest]
318274 include :
319275 - os : ubuntu-latest
320276 name : Linux
321- - os : windows-latest
322- name : Windows
323277 runs-on : ${{ matrix.os }}
324278 steps :
325279 - run : echo Running plugin functional tests
326280
327- - name : Configure git's autocrlf (Windows only)
328- if : matrix.os == 'windows-latest'
329- run : |
330- git config --global core.autocrlf false
331-
332- - name : Configure pagefile size (Windows only)
333- if : matrix.os == 'windows-latest'
334- uses : al-cheb/configure-pagefile-action@v1.3
335- with :
336- minimum-size : 16GB
337- maximum-size : 64GB
338- disk-root : ' C:'
339-
340281 - name : Checkout code
341282 uses : actions/checkout@v4
342283
@@ -358,13 +299,11 @@ jobs:
358299 npm i -g yarn@1.22.10
359300 yarn config set network-timeout 1000000 -g
360301
361- - name : Configure Yarn Cache (Linux)
362- if : matrix.os != 'windows-latest'
302+ - name : Configure Yarn Cache
363303 run : echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
364304
365305 - name : Initialize Yarn Cache
366306 uses : actions/cache@v4
367- if : matrix.os != 'windows-latest'
368307 with :
369308 path : ${{ env.YARN_CACHE_LOCATION }}
370309 key : yarn-${{ hashFiles('**/yarn.lock') }}
@@ -380,30 +319,17 @@ jobs:
380319 # v122
381320 version : 1250586
382321
383- - name : Setup Chrome (Linux)
384- if : matrix.os != 'windows-latest'
322+ - name : Setup Chrome
385323 run : |
386324 sudo rm -rf /usr/bin/google-chrome /opt/google/chrome
387325 sudo ln -s ${{steps.download-chrome.outputs.path}}/${{steps.download-chrome.outputs.binary}} /usr/bin/google-chrome
388326
389- - name : Setup Chrome (Windows)
390- if : matrix.os == 'windows-latest'
391- run : |
392- New-Item -Force -Type Directory "$Env:Programfiles/Google/Chrome/Application"
393- Remove-Item -Recurse -Force "$Env:Programfiles/Google/Chrome/Application/*"
394- Copy-Item -Force -Recurse "${{steps.download-chrome.outputs.path}}/*" "$Env:Programfiles/Google/Chrome/Application"
395-
396327 - name : Setup chromedriver
397328 run : node scripts/upgrade_chromedriver.js
398329
399- - name : Run bootstrap (Linux)
400- if : matrix.os != 'windows-latest'
330+ - name : Run bootstrap
401331 run : yarn osd bootstrap
402332
403- - name : Run bootstrap (Windows)
404- if : matrix.os == 'windows-latest'
405- run : yarn osd bootstrap || yarn osd bootstrap
406-
407333 - name : Build plugins
408334 run : node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10 --scan-dir "./test/plugin_functional/plugins"
409335
@@ -430,45 +356,11 @@ jobs:
430356 ext : tar.gz
431357 suffix : linux-x64
432358 script : build-platform --linux --skip-os-packages
433- - os : ubuntu-latest
434- name : Linux ARM64
435- ext : tar.gz
436- suffix : linux-arm64
437- script : build-platform --linux-arm --skip-os-packages
438- - os : macos-latest
439- name : macOS x64
440- ext : tar.gz
441- suffix : darwin-x64
442- script : build-platform --darwin --skip-os-packages
443- - os : macos-latest
444- name : macOS ARM64
445- ext : tar.gz
446- suffix : darwin-arm64
447- script : build-platform --darwin-arm --skip-os-packages
448- - os : windows-latest
449- name : Windows x64
450- ext : zip
451- suffix : windows-x64
452- script : build-platform --windows --skip-os-packages
453359 runs-on : ${{ matrix.os }}
454360 defaults :
455361 run :
456362 working-directory : ./artifacts
457363 steps :
458- - name : Configure git's autocrlf (Windows only)
459- if : matrix.os == 'windows-latest'
460- run : |
461- git config --global core.autocrlf false
462- working-directory : .
463-
464- - name : Configure pagefile size (Windows only)
465- if : matrix.os == 'windows-latest'
466- uses : al-cheb/configure-pagefile-action@v1.3
467- with :
468- minimum-size : 16GB
469- maximum-size : 64GB
470- disk-root : ' C:'
471-
472364 - name : Checkout code
473365 uses : actions/checkout@v4
474366 with :
@@ -486,39 +378,25 @@ jobs:
486378 npm i -g yarn@1.22.10
487379 yarn config set network-timeout 1000000 -g
488380
489- - name : Configure Yarn Cache (Linux)
490- if : matrix.os != 'windows-latest'
381+ - name : Configure Yarn Cache
491382 run : echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
492383
493384 - name : Initialize Yarn Cache
494385 uses : actions/cache@v4
495- if : matrix.os != 'windows-latest'
496386 with :
497387 path : ${{ env.YARN_CACHE_LOCATION }}
498388 key : yarn-${{ hashFiles('**/yarn.lock') }}
499389 restore-keys : |
500390 yarn-
501391
502- - name : Get package version (Linux)
503- if : matrix.os != 'windows-latest'
392+ - name : Get package version
504393 run : |
505394 echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
506395
507- - name : Get artifact build name (Linux)
508- if : matrix.os != 'windows-latest'
396+ - name : Get artifact build name
509397 run : |
510398 echo "ARTIFACT_BUILD_NAME=opensearch-dashboards-${{ env.VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}" >> $GITHUB_ENV
511399
512- - name : Get package version (Windows)
513- if : matrix.os == 'windows-latest'
514- run : |
515- echo "VERSION=$(yarn --silent pkg-version)" >> $env:GITHUB_ENV
516-
517- - name : Get artifact build name (Windows)
518- if : matrix.os == 'windows-latest'
519- run : |
520- echo "ARTIFACT_BUILD_NAME=opensearch-dashboards-${{ env.VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}" >> $env:GITHUB_ENV
521-
522400 - name : Run bootstrap
523401 run : yarn osd bootstrap
524402
@@ -535,6 +413,7 @@ jobs:
535413
536414 bwc-tests :
537415 needs : [build-min-artifact-tests]
416+ if : github.ref != 'refs/heads/fix/chat-basepath-handling' && (github.event_name != 'pull_request' || github.head_ref != 'fix/chat-basepath-handling')
538417 runs-on : ubuntu-latest
539418 container :
540419 image : docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2
0 commit comments