-
Notifications
You must be signed in to change notification settings - Fork 141
71 lines (59 loc) · 1.91 KB
/
sql-cli-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
name: SQL CLI Test and Build
on:
pull_request:
push:
branches-ignore:
- 'dependabot/**'
paths:
- 'sql-cli/**'
- '.github/workflows/sql-cli-test-and-build-workflow.yml'
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: sql-cli
strategy:
matrix:
python-version: [3.8]
opensearch-version: [ latest ]
steps:
- name: Checkout SQL CLI
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install setuptools wheel
# tests are designed to run against http://localhost:9200, so we have to disable/remove security plugin
- name: Download and run OpenSearch
run: |
docker run -p 9200:9200 -e "discovery.type=single-node" -e "DISABLE_SECURITY_PLUGIN=true" --name test -d opensearchproject/opensearch:${{ matrix.opensearch-version }}
- name: Wait for cluster to start
uses: nick-fields/retry@v2
with:
timeout_seconds: 1
max_attempts: 30
command: curl -q localhost:9200
- name: Run Tox Testing
run: tox
- name: Build Artifact
run: python setup.py sdist bdist_wheel
- name: Create Artifact Path
run: |
mkdir -p opensearchsql-builds
cp -r ./dist/*.tar.gz ./dist/*.whl opensearchsql-builds/
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: opensearchsql
path: sql-cli/opensearchsql-builds
- name: Clean up container
if: always()
run: |
docker container stop test
docker container rm test