This repository has been archived by the owner on Aug 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
101 lines (84 loc) · 3.85 KB
/
kibana-reports-test-and-build-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
name: Test and Build Kibana Reports
on: [pull_request, push]
env:
PLUGIN_NAME: opendistroReportsKibana
OD_VERSION: 1.13.2.0
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Plugin
uses: actions/checkout@v1
- name: Checkout Kibana
uses: actions/checkout@v1
with:
repository: elastic/kibana
ref: v7.10.2
path: kibana-reports/kibana
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "10.23.1"
- name: Move Kibana Reports to Plugins Dir
run: mv kibana-reports kibana/plugins/${{ env.PLUGIN_NAME }}
- name: Add Chromium Binary to Reporting for Testing
run: |
sudo apt install -y libnss3-dev fonts-liberation libfontconfig1
cd kibana/plugins/${{ env.PLUGIN_NAME }}
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip
rm chromium-linux-x64.zip
- name: Kibana Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn kbn bootstrap
- name: Test
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn test --coverage
- name: Build Artifact
run: |
cd kibana/plugins/${{ env.PLUGIN_NAME }}
yarn build
cd build
mkdir -p ./{linux-x64,linux-arm64,windows-x64}/kibana/${{ env.PLUGIN_NAME }}
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-arm64.zip
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip
cd linux-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
cd linux-arm64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-arm64.zip
unzip chromium-linux-arm64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
cd windows-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
unzip chromium-windows-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
- name: Upload Artifact For Linux x64
uses: actions/upload-artifact@v1
with:
name: kibana-reports-linux-x64
path: kibana/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip
- name: Upload Artifact For Linux arm64
uses: actions/upload-artifact@v1
with:
name: kibana-reports-linux-arm64
path: kibana/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-arm64.zip
- name: Upload Artifact For Windows
uses: actions/upload-artifact@v1
with:
name: kibana-reports-windows-x64
path: kibana/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip