8
8
OPENSEARCH_VERSION : ' 1.3'
9
9
OPENSEARCH_PLUGIN_VERSION : 1.3.7.0
10
10
11
+
11
12
jobs :
12
- build :
13
+ linux- build :
13
14
runs-on : ubuntu-latest
14
15
steps :
15
16
- name : Checkout Plugin
@@ -20,21 +21,26 @@ jobs:
20
21
with :
21
22
repository : opensearch-project/Opensearch-Dashboards
22
23
ref : ${{ env.OPENSEARCH_VERSION }}
23
- path : OpenSearch-Dashboards
24
-
25
- - name : Setup Node
26
- uses : actions/setup-node@v1
27
- with :
28
- node-version : " 10.24.1"
24
+ path : dashboards-reports/OpenSearch-Dashboards
25
+
26
+ - name : Get node version
27
+ id : versions_step
28
+ run :
29
+ echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
30
+ - name : Setup Node
31
+ uses : actions/setup-node@v1
32
+ with :
33
+ node-version : ${{ steps.versions_step.outputs.node_version }}
34
+ registry-url : ' https://registry.npmjs.org'
29
35
30
36
- name : Move Dashboards Reports to Plugins Dir
31
- run : mv dashboards-reports ../ OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
37
+ run : mv dashboards-reports OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
32
38
33
39
- name : Add Chromium Binary to Reporting for Testing
34
40
run : |
35
41
sudo apt update
36
42
sudo apt install -y libnss3-dev fonts-liberation libfontconfig1
37
- cd ../ OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
43
+ cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
38
44
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
39
45
unzip chromium-linux-x64.zip
40
46
rm chromium-linux-x64.zip
@@ -44,32 +50,31 @@ jobs:
44
50
with :
45
51
timeout_minutes : 30
46
52
max_attempts : 3
47
- command : cd ../ OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn osd bootstrap
53
+ command : cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn osd bootstrap
48
54
49
55
- name : Test
50
56
uses : nick-invision/retry@v1
51
57
with :
52
58
timeout_minutes : 30
53
59
max_attempts : 3
54
- command : cd ../ OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn test --coverage
60
+ command : cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn test --coverage
55
61
56
62
- name : Upload coverage
57
63
uses : codecov/codecov-action@v1
58
64
with :
59
65
flags : dashboards-reports
60
- directory : ../ OpenSearch-Dashboards/plugins/
66
+ directory : OpenSearch-Dashboards/plugins/
61
67
token : ${{ secrets.CODECOV_TOKEN }}
62
68
63
69
- name : Build Artifact
64
70
run : |
65
- cd ../ OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
71
+ cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
66
72
yarn build
67
73
68
74
cd build
69
- mkdir -p ./{linux-x64,linux-arm64,windows-x64 }/opensearch-dashboards/${{ env.PLUGIN_NAME }}
75
+ mkdir -p ./{linux-x64,linux-arm64}/opensearch-dashboards/${{ env.PLUGIN_NAME }}
70
76
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip
71
77
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip
72
- mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
73
78
74
79
cd linux-x64
75
80
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
@@ -85,27 +90,94 @@ jobs:
85
90
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
86
91
cd ..
87
92
88
- cd windows-x64
89
- wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
90
- unzip chromium-windows-x64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }}
91
- zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards
92
- mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
93
- cd ..
94
-
95
93
- name : Upload Artifact For Linux x64
96
94
uses : actions/upload-artifact@v1
97
95
with :
98
96
name : dashboards-reports-linux-x64
99
- path : ../ OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip
97
+ path : OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip
100
98
101
99
- name : Upload Artifact For Linux arm64
102
100
uses : actions/upload-artifact@v1
103
101
with :
104
102
name : dashboards-reports-linux-arm64
105
- path : ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip
103
+ path : OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip
104
+
105
+ windows-build :
106
+ runs-on : windows-latest
107
+ steps :
108
+ - name : Checkout Plugin
109
+ uses : actions/checkout@v1
110
+
111
+ # Enable longer filenames for windows
112
+ - name : Enable longer filenames
113
+ run : git config --system core.longpaths true
114
+
115
+ - name : Checkout OpenSearch Dashboards
116
+ uses : actions/checkout@v1
117
+ with :
118
+ repository : opensearch-project/Opensearch-Dashboards
119
+ ref : ${{ env.OPENSEARCH_VERSION }}
120
+ path : dashboards-reports/OpenSearch-Dashboards
121
+
122
+ - name : Get node version
123
+ id : versions_step
124
+ run :
125
+ echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
126
+
127
+ - name : Setup Node
128
+ uses : actions/setup-node@v1
129
+ with :
130
+ node-version : ${{ steps.versions_step.outputs.node_version }}
131
+ registry-url : ' https://registry.npmjs.org'
132
+
133
+
134
+ - name : Move Dashboards Reports to Plugins Dir
135
+ run : mv dashboards-reports OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
136
+
137
+ - name : Add Chromium Binary to Reporting for Testing
138
+ run : |
139
+ cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
140
+ curl.exe -LO https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
141
+ Expand-Archive -Path 'chromium-windows-x64.zip'
142
+ Move-Item -Path "./chromium-windows-x64/.chromium" -Destination "./.chromium"
143
+ rd chromium-windows-x64.zip
144
+ rd chromium-windows-x64
145
+
146
+ - name : OpenSearch Dashboards Plugin Bootstrap
147
+ uses : nick-invision/retry@v1
148
+ with :
149
+ timeout_minutes : 30
150
+ max_attempts : 3
151
+ command : cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} && yarn osd bootstrap
152
+
153
+ - name : Test
154
+ uses : nick-invision/retry@v1
155
+ with :
156
+ timeout_minutes : 30
157
+ max_attempts : 3
158
+ command : cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} && yarn test
159
+
160
+ - name : Build Artifact
161
+ run : |
162
+ cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
163
+ yarn build
164
+
165
+ cd build
166
+ mkdir -p ./windows-x64/opensearch-dashboards/${{ env.PLUGIN_NAME }}
167
+ mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
168
+
169
+ cd windows-x64
170
+ curl.exe -LO https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
171
+ Expand-Archive -Path 'chromium-windows-x64.zip'
172
+ Move-Item -Path "./chromium-windows-x64/.chromium" -Destination "./opensearch-dashboards/${{ env.PLUGIN_NAME }}"
173
+ rd chromium-windows-x64.zip
174
+ rd chromium-windows-x64
175
+ Compress-Archive -Path "./${{ env.ARTIFACT_NAME }}-*.zip" -Destination "./opensearch-dashboards"
176
+ mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
177
+ cd ..
106
178
107
179
- name : Upload Artifact For Windows
108
180
uses : actions/upload-artifact@v1
109
181
with :
110
182
name : dashboards-reports-windows-x64
111
- path : ../ OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
183
+ path : OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
0 commit comments