Skip to content

Commit 6efd7b1

Browse files
rupal-bqderek-ho
andauthored
[backport 1.3] Enable windows build (#561)
* feat: enable windows and macos build (#504) Signed-off-by: Derek Ho <[email protected]> * Remove macos Signed-off-by: Rupal Mahajan <[email protected]> * Remove macos from dashboards report Signed-off-by: Rupal Mahajan <[email protected]> * Fix build Signed-off-by: Rupal Mahajan <[email protected]> * Update setup node for linux Signed-off-by: Rupal Mahajan <[email protected]> Signed-off-by: Derek Ho <[email protected]> Signed-off-by: Rupal Mahajan <[email protected]> Co-authored-by: Derek Ho <[email protected]>
1 parent d3f36b5 commit 6efd7b1

File tree

5 files changed

+153
-38
lines changed

5 files changed

+153
-38
lines changed

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

Lines changed: 97 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ env:
88
OPENSEARCH_VERSION: '1.3'
99
OPENSEARCH_PLUGIN_VERSION: 1.3.7.0
1010

11+
1112
jobs:
12-
build:
13+
linux-build:
1314
runs-on: ubuntu-latest
1415
steps:
1516
- name: Checkout Plugin
@@ -20,21 +21,26 @@ jobs:
2021
with:
2122
repository: opensearch-project/Opensearch-Dashboards
2223
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'
2935

3036
- 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 }}
3238

3339
- name: Add Chromium Binary to Reporting for Testing
3440
run: |
3541
sudo apt update
3642
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 }}
3844
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
3945
unzip chromium-linux-x64.zip
4046
rm chromium-linux-x64.zip
@@ -44,32 +50,31 @@ jobs:
4450
with:
4551
timeout_minutes: 30
4652
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
4854

4955
- name: Test
5056
uses: nick-invision/retry@v1
5157
with:
5258
timeout_minutes: 30
5359
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
5561

5662
- name: Upload coverage
5763
uses: codecov/codecov-action@v1
5864
with:
5965
flags: dashboards-reports
60-
directory: ../OpenSearch-Dashboards/plugins/
66+
directory: OpenSearch-Dashboards/plugins/
6167
token: ${{ secrets.CODECOV_TOKEN }}
6268

6369
- name: Build Artifact
6470
run: |
65-
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
71+
cd OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
6672
yarn build
6773
6874
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 }}
7076
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip
7177
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
7378
7479
cd linux-x64
7580
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
@@ -85,27 +90,94 @@ jobs:
8590
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
8691
cd ..
8792
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-
9593
- name: Upload Artifact For Linux x64
9694
uses: actions/upload-artifact@v1
9795
with:
9896
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
10098

10199
- name: Upload Artifact For Linux arm64
102100
uses: actions/upload-artifact@v1
103101
with:
104102
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 ..
106178
107179
- name: Upload Artifact For Windows
108180
uses: actions/upload-artifact@v1
109181
with:
110182
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

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

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66
OPENSEARCH_VERSION: '1.3.5-SNAPSHOT'
77

88
jobs:
9-
build:
9+
linux-build:
1010
strategy:
1111
matrix:
1212
java:
@@ -51,6 +51,47 @@ jobs:
5151
- name: Upload Artifacts
5252
uses: actions/upload-artifact@v1
5353
with:
54-
name: reports-scheduler
54+
name: reports-scheduler-linux
5555
path: reports-scheduler-builds
5656

57+
windows-build:
58+
strategy:
59+
matrix:
60+
java:
61+
- 8
62+
- 11
63+
- 14
64+
runs-on: windows-latest
65+
66+
steps:
67+
- name: Set up JDK ${{ matrix.java }}
68+
uses: actions/setup-java@v1
69+
with:
70+
java-version: ${{ matrix.java }}
71+
72+
# reports-scheduler
73+
- name: Checkout Reports Scheduler
74+
uses: actions/checkout@v2
75+
76+
# Disable bwc tests since first release
77+
# - name: RunBackwards Compatibility Tests
78+
# run: |
79+
# cd reports-scheduler
80+
# echo "Running backwards compatibility tests ..."
81+
# ./gradlew.bat bwcTestSuite
82+
83+
- name: Build with Gradle
84+
run: |
85+
cd reports-scheduler
86+
./gradlew.bat build -x integTest -x jacocoTestReport
87+
88+
- name: Create Artifact Path
89+
run: |
90+
mkdir -p reports-scheduler-builds
91+
cp -r ./reports-scheduler/build/distributions/*.zip reports-scheduler-builds/
92+
93+
- name: Upload Artifacts
94+
uses: actions/upload-artifact@v1
95+
with:
96+
name: reports-scheduler-windows
97+
path: reports-scheduler-builds

dashboards-reports/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
@@ -172,7 +172,7 @@ exports[`<ReportDetails /> panel render 5 hours recurring component 1`] = `
172172
<dd
173173
class="euiDescriptionList__description"
174174
>
175-
Invalid Date -&gt; 10/23/2020, 1:53:35 PM
175+
Invalid Date -&gt; 10/23/2020, 8:53:35 PM
176176
</dd>
177177
</dl>
178178
</div>
@@ -562,7 +562,7 @@ exports[`<ReportDetails /> panel render on-demand component 1`] = `
562562
<dd
563563
class="euiDescriptionList__description"
564564
>
565-
Invalid Date -&gt; 10/23/2020, 1:53:35 PM
565+
Invalid Date -&gt; 10/23/2020, 8:53:35 PM
566566
</dd>
567567
</dl>
568568
</div>

dashboards-reports/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>

dashboards-reports/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)