Skip to content

Commit

Permalink
Merge pull request #837 from Bit-Quill/integ-reorganize-workflows
Browse files Browse the repository at this point in the history
Reorganize GitHub workflows.

(cherry picked from commit 10e44ee)
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Sep 28, 2022
1 parent ab67be6 commit 28b97a4
Show file tree
Hide file tree
Showing 18 changed files with 252 additions and 633 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/bi-connectors.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Build connectors for BI tools

on:
pull_request:
types: [opened, reopened]
push:
paths:
- 'bi-connectors/PowerBIConnector/**'
Expand Down
63 changes: 16 additions & 47 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,39 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
# ******** NOTE ********

name: "CodeQL"

on:
pull_request:
branches:
- master
- opendistro-*
- 'main'
- '[1-9]+.[0-9x]+'
types: [opened, reopened]
push:
branches:
- master
- opendistro-*

branches-ignore:
- 'dependabot/**'
paths:
- '**/*.java'
- '.github/workflows/codeql-analysis.yml'

jobs:
analyze:
name: CodeQL-Scan
runs-on: ubuntu-18.04

runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
strategy:
fail-fast: false
matrix:
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/dco.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
- name: DCO Check
uses: tim-actions/[email protected]
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
commits: ${{ steps.get-pr-commits.outputs.commits }}
5 changes: 4 additions & 1 deletion .github/workflows/draft-release-notes-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Release Drafter

on:
pull_request:
types: [opened, reopened]
push:
branches:
- main
- 'main'
- '[1-9]+.[0-9x]+'

jobs:
update_release_draft:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Link Checker

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [opened, reopened]
push:
branches:
- 'main'
- '[1-9]+.[0-9x]+'

jobs:
linkchecker:
Expand Down
71 changes: 0 additions & 71 deletions .github/workflows/sql-cli-release-workflow.yml

This file was deleted.

51 changes: 30 additions & 21 deletions .github/workflows/sql-cli-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
name: SQL CLI Test and Build

on: [pull_request, push]
on:
pull_request:
types: [opened, reopened]
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@v2
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -28,26 +36,21 @@ jobs:
pip install -r requirements-dev.txt
pip install setuptools wheel
#TODO: will setup CI for IT once we have OpenSearch and sql plugin release. Not it only runs UT
# It can also be refactored by launching OpenSearch instance with plugin installed from gradle.

# - name: Set up ES and install SQL plugin
# run: |
# sudo add-apt-repository ppa:openjdk-r/ppa
# sudo apt update
# sudo apt install openjdk-14-jdk
# sudo apt install unzip
# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.10.0-amd64.deb
# sudo dpkg -i elasticsearch-oss-7.10.0-amd64.deb
# 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
# sudo systemctl start elasticsearch.service
# 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: Stop ES
# run: sudo systemctl stop elasticsearch.service

- name: Build Artifact
run: python setup.py sdist bdist_wheel

Expand All @@ -57,7 +60,13 @@ jobs:
cp -r ./dist/*.tar.gz ./dist/*.whl opensearchsql-builds/
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: opensearchsql
path: sql-cli/opensearchsql-builds

- name: Clean up container
if: always()
run: |
docker container stop test
docker container rm test
49 changes: 0 additions & 49 deletions .github/workflows/sql-jdbc-push-jdbc-maven.yml

This file was deleted.

Loading

0 comments on commit 28b97a4

Please sign in to comment.