Skip to content

Commit c79cc0c

Browse files
authored
feat: enable windows and macos build (opensearch-project#504) (opensearch-project#511)
Signed-off-by: Derek Ho <[email protected]>
1 parent d7701cb commit c79cc0c

File tree

5 files changed

+246
-24
lines changed

5 files changed

+246
-24
lines changed

.github/workflows/dashboards-reports-test-and-build-workflow.yml

Lines changed: 149 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ env:
88
OPENSEARCH_VERSION: 'main'
99
OPENSEARCH_PLUGIN_VERSION: 2.4.0.0
1010

11+
1112
jobs:
12-
build:
13+
linux-build:
1314
runs-on: ubuntu-latest
1415
steps:
1516
- name: Checkout Plugin
@@ -73,10 +74,9 @@ jobs:
7374
yarn build
7475
7576
cd build
76-
mkdir -p ./{linux-x64,linux-arm64,windows-x64}/opensearch-dashboards/${{ env.PLUGIN_NAME }}
77+
mkdir -p ./{linux-x64,linux-arm64}/opensearch-dashboards/${{ env.PLUGIN_NAME }}
7778
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip
7879
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip
79-
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
8080
8181
cd linux-x64
8282
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
@@ -92,13 +92,6 @@ jobs:
9292
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
9393
cd ..
9494
95-
cd windows-x64
96-
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
97-
unzip chromium-windows-x64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }}
98-
zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards
99-
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
100-
cd ..
101-
10295
- name: Upload Artifact For Linux x64
10396
uses: actions/upload-artifact@v1
10497
with:
@@ -111,8 +104,153 @@ jobs:
111104
name: dashboards-reports-linux-arm64
112105
path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip
113106

107+
windows-build:
108+
runs-on: windows-latest
109+
steps:
110+
- name: Checkout Plugin
111+
uses: actions/checkout@v1
112+
113+
# Enable longer filenames for windows
114+
- name: Enable longer filenames
115+
run: git config --system core.longpaths true
116+
117+
- name: Checkout OpenSearch Dashboards
118+
uses: actions/checkout@v1
119+
with:
120+
repository: opensearch-project/Opensearch-Dashboards
121+
ref: ${{ env.OPENSEARCH_VERSION }}
122+
path: dashboards-reports/OpenSearch-Dashboards
123+
124+
- name: Get node version
125+
id: versions_step
126+
run:
127+
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
128+
129+
- name: Setup Node
130+
uses: actions/setup-node@v1
131+
with:
132+
node-version: ${{ steps.versions_step.outputs.node_version }}
133+
registry-url: 'https://registry.npmjs.org'
134+
135+
136+
- name: Move Dashboards Reports to Plugins Dir
137+
run: mv dashboards-reports OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
138+
139+
- name: Add Chromium Binary to Reporting for Testing
140+
run: |
141+
cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
142+
curl.exe -LO https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
143+
Expand-Archive -Path 'chromium-windows-x64.zip'
144+
Move-Item -Path "./chromium-windows-x64/.chromium" -Destination "./.chromium"
145+
rd chromium-windows-x64.zip
146+
rd chromium-windows-x64
147+
148+
- name: OpenSearch Dashboards Plugin Bootstrap
149+
uses: nick-invision/retry@v1
150+
with:
151+
timeout_minutes: 30
152+
max_attempts: 3
153+
command: cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} && yarn osd bootstrap
154+
155+
- name: Test
156+
uses: nick-invision/retry@v1
157+
with:
158+
timeout_minutes: 30
159+
max_attempts: 3
160+
command: cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} && yarn test
161+
162+
- name: Build Artifact
163+
run: |
164+
cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
165+
yarn build
166+
167+
cd build
168+
mkdir -p ./windows-x64/opensearch-dashboards/${{ env.PLUGIN_NAME }}
169+
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
170+
171+
cd windows-x64
172+
curl.exe -LO https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
173+
Expand-Archive -Path 'chromium-windows-x64.zip'
174+
Move-Item -Path "./chromium-windows-x64/.chromium" -Destination "./opensearch-dashboards/${{ env.PLUGIN_NAME }}"
175+
rd chromium-windows-x64.zip
176+
rd chromium-windows-x64
177+
Compress-Archive -Path "./${{ env.ARTIFACT_NAME }}-*.zip" -Destination "./opensearch-dashboards"
178+
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
179+
cd ..
180+
114181
- name: Upload Artifact For Windows
115182
uses: actions/upload-artifact@v1
116183
with:
117184
name: dashboards-reports-windows-x64
118-
path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
185+
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
186+
187+
macos-build:
188+
runs-on: macos-latest
189+
steps:
190+
- name: Checkout Plugin
191+
uses: actions/checkout@v1
192+
193+
- name: Checkout OpenSearch Dashboards
194+
uses: actions/checkout@v1
195+
with:
196+
repository: opensearch-project/Opensearch-Dashboards
197+
ref: ${{ env.OPENSEARCH_VERSION }}
198+
path: dashboards-reports/OpenSearch-Dashboards
199+
200+
- name: Get node version
201+
id: versions_step
202+
run:
203+
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
204+
205+
- name: Setup Node
206+
uses: actions/setup-node@v1
207+
with:
208+
node-version: ${{ steps.versions_step.outputs.node_version }}
209+
registry-url: 'https://registry.npmjs.org'
210+
211+
212+
- name: Move Dashboards Reports to Plugins Dir
213+
run: mv dashboards-reports OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
214+
215+
- name: Add Chromium Binary to Reporting for Testing
216+
run: |
217+
cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
218+
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-macos-x64.zip
219+
unzip chromium-macos-x64.zip
220+
rm chromium-macos-x64.zip
221+
222+
- name: OpenSearch Dashboards Plugin Bootstrap
223+
uses: nick-invision/retry@v1
224+
with:
225+
timeout_minutes: 30
226+
max_attempts: 3
227+
command: cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn osd bootstrap
228+
229+
- name: Test
230+
uses: nick-invision/retry@v1
231+
with:
232+
timeout_minutes: 30
233+
max_attempts: 3
234+
command: cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn test
235+
236+
- name: Build Artifact
237+
run: |
238+
cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
239+
yarn build
240+
241+
cd build
242+
mkdir -p ./macos-x64/opensearch-dashboards/${{ env.PLUGIN_NAME }}
243+
mv ./${{ env.PLUGIN_NAME }}-*.zip ./macos-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-macos-x64.zip
244+
245+
cd macos-x64
246+
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-macos-x64.zip
247+
unzip chromium-macos-x64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }}
248+
zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards
249+
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
250+
cd ..
251+
252+
- name: Upload Artifact For MacOS x64
253+
uses: actions/upload-artifact@v1
254+
with:
255+
name: dashboards-reports-macosx-x64
256+
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-macos-x64.zip

.github/workflows/reports-scheduler-test-and-build-workflow.yml

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test and Build Reports Scheduler
33
on: [push, pull_request]
44

55
jobs:
6-
build:
6+
linux-build:
77
strategy:
88
matrix:
99
java:
@@ -41,5 +41,87 @@ jobs:
4141
- name: Upload Artifacts
4242
uses: actions/upload-artifact@v1
4343
with:
44-
name: reports-scheduler
44+
name: reports-scheduler-linux
45+
path: reports-scheduler-builds
46+
47+
windows-build:
48+
strategy:
49+
matrix:
50+
java:
51+
- 11
52+
- 17
53+
runs-on: windows-latest
54+
55+
steps:
56+
- name: Set up JDK ${{ matrix.java }}
57+
uses: actions/setup-java@v1
58+
with:
59+
java-version: ${{ matrix.java }}
60+
61+
# reports-scheduler
62+
- name: Checkout Reports Scheduler
63+
uses: actions/checkout@v2
64+
65+
# Disable bwc tests since first release
66+
# - name: RunBackwards Compatibility Tests
67+
# run: |
68+
# cd reports-scheduler
69+
# echo "Running backwards compatibility tests ..."
70+
# ./gradlew.bat bwcTestSuite
71+
72+
- name: Build with Gradle
73+
run: |
74+
cd reports-scheduler
75+
./gradlew.bat build -x integTest -x jacocoTestReport
76+
77+
- name: Create Artifact Path
78+
run: |
79+
mkdir -p reports-scheduler-builds
80+
cp -r ./reports-scheduler/build/distributions/*.zip reports-scheduler-builds/
81+
82+
- name: Upload Artifacts
83+
uses: actions/upload-artifact@v1
84+
with:
85+
name: reports-scheduler-windows
86+
path: reports-scheduler-builds
87+
88+
macos-build:
89+
strategy:
90+
matrix:
91+
java:
92+
- 11
93+
- 17
94+
runs-on: macos-latest
95+
96+
steps:
97+
- name: Set up JDK ${{ matrix.java }}
98+
uses: actions/setup-java@v1
99+
with:
100+
java-version: ${{ matrix.java }}
101+
102+
# reports-scheduler
103+
- name: Checkout Reports Scheduler
104+
uses: actions/checkout@v2
105+
106+
# Disable bwc tests since first release
107+
# - name: RunBackwards Compatibility Tests
108+
# run: |
109+
# cd reports-scheduler
110+
# echo "Running backwards compatibility tests ..."
111+
# ./gradlew bwcTestSuite
112+
113+
- name: Build with Gradle
114+
run: |
115+
cd reports-scheduler
116+
./gradlew build -x integTest -x jacocoTestReport
117+
118+
- name: Create Artifact Path
119+
run: |
120+
mkdir -p reports-scheduler-builds
121+
cp -r ./reports-scheduler/build/distributions/*.zip reports-scheduler-builds/
122+
123+
- name: Upload Artifacts
124+
uses: actions/upload-artifact@v1
125+
with:
126+
name: reports-scheduler-macos
45127
path: reports-scheduler-builds

public/components/main/report_details/__tests__/__snapshots__/report_details.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ exports[`<ReportDetails /> panel render 5 hours recurring component 1`] = `
192192
<dd
193193
class="euiDescriptionList__description"
194194
>
195-
Invalid Date -&gt; 10/23/2020, 1:53:35 PM
195+
Invalid Date -&gt; 10/23/2020, 8:53:35 PM
196196
</dd>
197197
</dl>
198198
</div>
@@ -599,7 +599,7 @@ exports[`<ReportDetails /> panel render on-demand component 1`] = `
599599
<dd
600600
class="euiDescriptionList__description"
601601
>
602-
Invalid Date -&gt; 10/23/2020, 1:53:35 PM
602+
Invalid Date -&gt; 10/23/2020, 8:53:35 PM
603603
</dd>
604604
</dl>
605605
</div>

public/components/report_definitions/report_settings/__tests__/__snapshots__/report_settings.test.tsx.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ exports[`<ReportSettings /> panel dashboard create from in-context 1`] = `
402402
data-test-subj="superDatePickerstartDatePopoverButton"
403403
title="2020-10-26T20:52:56.382Z"
404404
>
405-
Oct 26, 2020 @ 13:52:56.382
405+
Oct 26, 2020 @ 20:52:56.382
406406
</button>
407407
</div>
408408
</div>
@@ -426,7 +426,7 @@ exports[`<ReportSettings /> panel dashboard create from in-context 1`] = `
426426
data-test-subj="superDatePickerendDatePopoverButton"
427427
title="2020-10-27T20:52:56.384Z"
428428
>
429-
Oct 27, 2020 @ 13:52:56.384
429+
Oct 27, 2020 @ 20:52:56.384
430430
</button>
431431
</div>
432432
</div>
@@ -1585,7 +1585,7 @@ exports[`<ReportSettings /> panel display errors on create 1`] = `
15851585
data-test-subj="superDatePickerstartDatePopoverButton"
15861586
title="2020-10-26T20:52:56.382Z"
15871587
>
1588-
Oct 26, 2020 @ 13:52:56.382
1588+
Oct 26, 2020 @ 20:52:56.382
15891589
</button>
15901590
</div>
15911591
</div>
@@ -1609,7 +1609,7 @@ exports[`<ReportSettings /> panel display errors on create 1`] = `
16091609
data-test-subj="superDatePickerendDatePopoverButton"
16101610
title="2020-10-27T20:52:56.384Z"
16111611
>
1612-
Oct 27, 2020 @ 13:52:56.384
1612+
Oct 27, 2020 @ 20:52:56.384
16131613
</button>
16141614
</div>
16151615
</div>
@@ -6506,7 +6506,7 @@ exports[`<ReportSettings /> panel saved search create from in-context 1`] = `
65066506
data-test-subj="superDatePickerstartDatePopoverButton"
65076507
title="2020-10-26T20:52:56.382Z"
65086508
>
6509-
Oct 26, 2020 @ 13:52:56.382
6509+
Oct 26, 2020 @ 20:52:56.382
65106510
</button>
65116511
</div>
65126512
</div>
@@ -6530,7 +6530,7 @@ exports[`<ReportSettings /> panel saved search create from in-context 1`] = `
65306530
data-test-subj="superDatePickerendDatePopoverButton"
65316531
title="2020-10-27T20:52:56.384Z"
65326532
>
6533-
Oct 27, 2020 @ 13:52:56.384
6533+
Oct 27, 2020 @ 20:52:56.384
65346534
</button>
65356535
</div>
65366536
</div>
@@ -7689,7 +7689,7 @@ exports[`<ReportSettings /> panel visualization create from in-context 1`] = `
76897689
data-test-subj="superDatePickerstartDatePopoverButton"
76907690
title="2020-10-26T20:52:56.382Z"
76917691
>
7692-
Oct 26, 2020 @ 13:52:56.382
7692+
Oct 26, 2020 @ 20:52:56.382
76937693
</button>
76947694
</div>
76957695
</div>
@@ -7713,7 +7713,7 @@ exports[`<ReportSettings /> panel visualization create from in-context 1`] = `
77137713
data-test-subj="superDatePickerendDatePopoverButton"
77147714
title="2020-10-27T20:52:56.384Z"
77157715
>
7716-
Oct 27, 2020 @ 13:52:56.384
7716+
Oct 27, 2020 @ 20:52:56.384
77177717
</button>
77187718
</div>
77197719
</div>

test/jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
process.env.TZ = 'America/Los_Angeles';
6+
//@ts-check
7+
8+
process.env.TZ = 'UTC';
79

810
module.exports = {
911
rootDir: '../',

0 commit comments

Comments
 (0)