forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (87 loc) · 3.02 KB
/
build_and_test_workflow.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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build and test
# trigger on every commit push and PR for all branches except feature branches
on:
push:
branches: [ '**', '!feature/**' ]
pull_request:
branches: [ '**', '!feature/**' ]
env:
TEST_BROWSER_HEADLESS: 1
CI: 1
GCS_UPLOAD_PREFIX: fake
TEST_OPENSEARCH_DASHBOARDS_HOST: localhost
TEST_OPENSEARCH_DASHBOARDS_PORT: 6610
TEST_OPENSEARCH_TRANSPORT_PORT: 9403
TEST_OPENSEARCH_PORT: 9400
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true
jobs:
build-lint-test:
runs-on: ubuntu-latest
name: Build and Verify
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version-file: ".nvmrc"
registry-url: 'https://registry.npmjs.org'
- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g yarn@1.22.10
- name: Run bootstrap
run: yarn osd bootstrap
- name: Run linter
id: linter
run: yarn lint
- name: Run unit tests with coverage
id: unit-tests
run: yarn test:jest:ci:coverage
- name: Run mocha tests with coverage
id: mocha-tests
run: yarn test:mocha:coverage
- name: Upload Code Coverage
id: upload-code-coverage
uses: codecov/codecov-action@v3
with:
directory: ./target/opensearch-dashboards-coverage
- name: Run integration tests
id: integration-tests
run: yarn test:jest_integration:ci
functional-tests:
runs-on: ubuntu-latest
name: Run functional tests
strategy:
matrix:
group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
steps:
- run: echo Running functional tests for ciGroup${{ matrix.group }}
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version-file: ".nvmrc"
registry-url: 'https://registry.npmjs.org'
- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g yarn@1.22.10
# github virtual env is the latest chrome
- name: Setup chromedriver
run: yarn add --dev chromedriver@100.0.0
- name: Run bootstrap
run: yarn osd bootstrap
- name: Build plugins
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10
- name: Run CI test group ${{ matrix.group }}
id: ftr-tests
run: node scripts/functional_tests.js --config test/functional/config.js --include ciGroup${{ matrix.group }}
env:
CI_GROUP: ciGroup${{ matrix.group }}
CI_PARALLEL_PROCESS_NUMBER: ciGroup${{ matrix.group }}
JOB: ci${{ matrix.group }}
CACHE_DIR: ciGroup${{ matrix.group }}