@@ -19,36 +19,57 @@ jobs:
19
19
name : Run integ tests without security
20
20
strategy :
21
21
matrix :
22
- os : [ubuntu-latest]
22
+ os : [ubuntu-latest, windows-latest ]
23
23
java : [11]
24
+ include :
25
+ - os : windows-latest
26
+ cypress_cache_folder : ~/AppData/Local/Cypress/Cache
27
+ - os : ubuntu-latest
28
+ cypress_cache_folder : ~/.cache/Cypress
24
29
runs-on : ${{ matrix.os }}
25
30
steps :
31
+ - name : Set up Java 11
32
+ uses : actions/setup-java@v3
33
+ with :
34
+ distribution : ' corretto'
35
+ java-version : ' 11'
36
+
37
+ - name : Enable longer filenames
38
+ if : ${{ matrix.os == 'windows-latest' }}
39
+ run : git config --system core.longpaths true
40
+
26
41
- name : Checkout Anomaly-Detection
27
42
uses : actions/checkout@v2
28
43
with :
29
44
path : anomaly-detection
30
45
repository : opensearch-project/anomaly-detection
31
46
ref : ${{ env.ANOMALY_DETECTION_PLUGIN_VERSION }}
32
- - name : Run Opensearch with plugin
47
+
48
+ - name : Run OpenSearch with plugin
33
49
run : |
34
50
cd anomaly-detection
35
51
./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} &
36
52
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done'
53
+ shell : bash
54
+
37
55
- name : Checkout OpenSearch Dashboards
38
56
uses : actions/checkout@v2
39
57
with :
40
58
repository : opensearch-project/OpenSearch-Dashboards
41
59
ref : ${{ env.OPENSEARCH_DASHBOARDS_VERSION }}
42
60
path : OpenSearch-Dashboards
61
+
43
62
- name : Checkout Anomaly Detection OpenSearch Dashboards plugin
44
63
uses : actions/checkout@v2
45
64
with :
46
65
path : OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
66
+
47
67
- name : Get node and yarn versions
48
68
id : versions_step
49
69
run : |
50
70
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
51
71
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
72
+
52
73
- name : Setup node
53
74
uses : actions/setup-node@v1
54
75
with :
@@ -60,37 +81,56 @@ jobs:
60
81
npm uninstall -g yarn
61
82
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
62
83
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}
84
+
63
85
- name : Bootstrap the plugin
64
86
run : |
65
87
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
66
88
yarn osd bootstrap
89
+
67
90
- name : Run OpenSearch Dashboards server
68
91
run : |
69
92
cd OpenSearch-Dashboards
70
93
yarn start --no-base-path --no-watch &
71
- sleep 300
94
+ shell : bash
95
+
96
+ # Window is slow so wait longer
97
+ - name : Sleep until OSD server starts - windows
98
+ if : ${{ matrix.os == 'windows-latest' }}
99
+ run : Start-Sleep -s 400
100
+ shell : powershell
101
+
102
+ - name : Sleep until OSD server starts - non-windows
103
+ if : ${{ matrix.os != 'windows-latest' }}
104
+ run : sleep 300
105
+ shell : bash
106
+
72
107
- name : Checkout opensearch-dashboards-functional-test
73
108
uses : actions/checkout@v2
74
109
with :
75
110
path : opensearch-dashboards-functional-test
76
111
repository : opensearch-project/opensearch-dashboards-functional-test
77
112
ref : ${{ env.OPENSEARCH_DASHBOARDS_FTREPO_VERSION }}
113
+
78
114
- name : Get Cypress version
79
115
id : cypress_version
80
116
run : |
81
117
echo "::set-output name=cypress_version::$(cat ./opensearch-dashboards-functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
118
+
82
119
- name : Cache Cypress
83
120
id : cache-cypress
84
121
uses : actions/cache@v1
85
122
with :
86
- path : ~/.cache/Cypress
123
+ path : ${{ matrix.cypress_cache_folder }}
87
124
key : cypress-cache-v2-${{ runner.os }}-${{ hashFiles('**/package.json') }}
88
125
env :
89
126
CYPRESS_INSTALL_BINARY : ${{ steps.cypress_version.outputs.cypress_version }}
90
127
- run : npx cypress cache list
91
128
- run : npx cypress cache path
129
+
92
130
- name : Run AD cypress tests
93
131
uses : cypress-io/github-action@v2
94
132
with :
95
133
working-directory : opensearch-dashboards-functional-test
96
134
command : yarn run cypress run --env SECURITY_ENABLED=false --spec cypress/integration/plugins/anomaly-detection-dashboards-plugin/*.js
135
+ env :
136
+ CYPRESS_CACHE_FOLDER : ${{ matrix.cypress_cache_folder }}
0 commit comments