Skip to content

Commit 10e44ee

Browse files
Merge pull request opensearch-project#837 from Bit-Quill/integ-reorganize-workflows
Reorganize GitHub workflows.
2 parents e04d6f8 + 63c5137 commit 10e44ee

18 files changed

+243
-628
lines changed

.github/workflows/bi-connectors.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build connectors for BI tools
22

33
on:
4+
pull_request:
5+
types: [opened, reopened]
46
push:
57
paths:
68
- 'bi-connectors/PowerBIConnector/**'

.github/workflows/codeql-analysis.yml

Lines changed: 16 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,39 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
# ******** NOTE ********
12-
131
name: "CodeQL"
142

153
on:
164
pull_request:
175
branches:
18-
- master
19-
- opendistro-*
6+
- 'main'
7+
- '[1-9]+.[0-9x]+'
8+
types: [opened, reopened]
209
push:
21-
branches:
22-
- master
23-
- opendistro-*
24-
10+
branches-ignore:
11+
- 'dependabot/**'
12+
paths:
13+
- '**/*.java'
14+
- '.github/workflows/codeql-analysis.yml'
2515

2616
jobs:
2717
analyze:
2818
name: CodeQL-Scan
29-
runs-on: ubuntu-18.04
30-
19+
runs-on: ubuntu-latest
20+
permissions:
21+
security-events: write
22+
actions: read
3123
strategy:
3224
fail-fast: false
3325
matrix:
3426
language: [ 'java' ]
35-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
36-
# Learn more...
37-
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
3827

3928
steps:
4029
- name: Checkout repository
41-
uses: actions/checkout@v2
30+
uses: actions/checkout@v3
4231

43-
# Initializes the CodeQL tools for scanning.
4432
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
33+
uses: github/codeql-action/init@v2
4634
with:
4735
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52-
53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54-
# If this step fails, then you should remove it and run the build manually (see below)
5536
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
57-
58-
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
60-
61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
64-
65-
#- run: |
66-
# make bootstrap
67-
# make release
68-
37+
uses: github/codeql-action/autobuild@v2
6938
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
39+
uses: github/codeql-action/analyze@v2

.github/workflows/dco.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
- name: DCO Check
1616
uses: tim-actions/[email protected]
1717
with:
18-
commits: ${{ steps.get-pr-commits.outputs.commits }}
18+
commits: ${{ steps.get-pr-commits.outputs.commits }}

.github/workflows/draft-release-notes-workflow.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Release Drafter
22

33
on:
4+
pull_request:
5+
types: [opened, reopened]
46
push:
57
branches:
6-
- main
8+
- 'main'
9+
- '[1-9]+.[0-9x]+'
710

811
jobs:
912
update_release_draft:

.github/workflows/link-checker.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Link Checker
2+
23
on:
3-
push:
4-
branches: [ main ]
54
pull_request:
6-
branches: [ main ]
5+
types: [opened, reopened]
6+
push:
7+
branches:
8+
- 'main'
9+
- '[1-9]+.[0-9x]+'
710

811
jobs:
912
linkchecker:

.github/workflows/sql-cli-release-workflow.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
name: SQL CLI Test and Build
22

3-
on: [pull_request, push]
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
push:
7+
branches-ignore:
8+
- 'dependabot/**'
9+
paths:
10+
- 'sql-cli/**'
11+
- '.github/workflows/sql-cli-test-and-build-workflow.yml'
412

513
jobs:
614
build:
7-
815
runs-on: ubuntu-latest
916
defaults:
1017
run:
1118
working-directory: sql-cli
1219
strategy:
1320
matrix:
1421
python-version: [3.8]
22+
opensearch-version: [ latest ]
1523

1624
steps:
1725
- name: Checkout SQL CLI
18-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
1927

2028
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
29+
uses: actions/setup-python@v4
2230
with:
2331
python-version: ${{ matrix.python-version }}
2432

@@ -28,26 +36,21 @@ jobs:
2836
pip install -r requirements-dev.txt
2937
pip install setuptools wheel
3038
31-
#TODO: will setup CI for IT once we have OpenSearch and sql plugin release. Not it only runs UT
32-
# It can also be refactored by launching OpenSearch instance with plugin installed from gradle.
33-
34-
# - name: Set up ES and install SQL plugin
35-
# run: |
36-
# sudo add-apt-repository ppa:openjdk-r/ppa
37-
# sudo apt update
38-
# sudo apt install openjdk-14-jdk
39-
# sudo apt install unzip
40-
# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.10.0-amd64.deb
41-
# sudo dpkg -i elasticsearch-oss-7.10.0-amd64.deb
42-
# sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opensearch-sql/opensearch_sql-1.12.0.0.zip
43-
# sudo systemctl start elasticsearch.service
39+
# tests are designed to run against http://localhost:9200, so we have to disable/remove security plugin
40+
- name: Download and run OpenSearch
41+
run: |
42+
docker run -p 9200:9200 -e "discovery.type=single-node" -e "DISABLE_SECURITY_PLUGIN=true" --name test -d opensearchproject/opensearch:${{ matrix.opensearch-version }}
43+
44+
- name: Wait for cluster to start
45+
uses: nick-fields/retry@v2
46+
with:
47+
timeout_seconds: 1
48+
max_attempts: 30
49+
command: curl -q localhost:9200
4450

4551
- name: Run Tox Testing
4652
run: tox
4753

48-
# - name: Stop ES
49-
# run: sudo systemctl stop elasticsearch.service
50-
5154
- name: Build Artifact
5255
run: python setup.py sdist bdist_wheel
5356

@@ -57,7 +60,13 @@ jobs:
5760
cp -r ./dist/*.tar.gz ./dist/*.whl opensearchsql-builds/
5861
5962
- name: Upload Artifact
60-
uses: actions/upload-artifact@v2
63+
uses: actions/upload-artifact@v3
6164
with:
6265
name: opensearchsql
6366
path: sql-cli/opensearchsql-builds
67+
68+
- name: Clean up container
69+
if: always()
70+
run: |
71+
docker container stop test
72+
docker container rm test

.github/workflows/sql-jdbc-push-jdbc-maven.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)