-
Notifications
You must be signed in to change notification settings - Fork 13
78 lines (61 loc) · 2.2 KB
/
reporting-cli-test-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
name: Reporting CLI tests workflow
on: [pull_request, push]
env:
CLI_VERSION: 1.0.0
jobs:
run-tests:
name: Run reporting cli tests
strategy:
matrix:
os: [ubuntu-latest]
java: [11]
node-version: [14.x]
opensearch-version: [ latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Reporting CLI
uses: actions/checkout@v2
- name: Configure sysctl limits
run: |
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Download and run Opensearch and Dashboard
run: |
wget https://opensearch.org/samples/docker-compose.yml
docker-compose --env-file .github/workflows/.env up --detach
- name: Check Docker containers
run: docker ps -a
- name: Sleep for 200s seconds
run: sleep 200s
shell: bash
- name: Wait for cluster to start
uses: nick-fields/retry@v2
with:
timeout_seconds: 1
max_attempts: 30
command: curl https://localhost:9200 -ku 'admin:admin'
retry_wait_seconds: 30
- name: Add sample data
run: |
curl -XPOST -u 'admin:admin' 'http://localhost:5601/api/sample_data/ecommerce' -H 'osd-xsrf:true'
curl -XPOST -u 'admin:admin' 'http://localhost:5601/api/sample_data/logs' -H 'osd-xsrf:true' -H 'securitytenant: global'
curl -XPOST -u 'admin:admin' 'http://localhost:5601/api/sample_data/flights' -H 'osd-xsrf:true' -H 'securitytenant: admin_tenant'
- name: Run integration tests
run: |
yarn
yarn test
- name: Create a tarball from a package
run: |
npm pack
- name: Rename artifact
run: |
mv opensearch-project-reporting-cli-${{ env.CLI_VERSION }}.tgz opensearch-reporting-cli-${{ env.CLI_VERSION }}.tgz
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: opensearch-reporting-cli-${{ env.CLI_VERSION }}-linux
path: ./opensearch-reporting-cli-${{ env.CLI_VERSION }}.tgz
- name: Clean up container
if: always()
run: |
docker-compose down