Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize GitHub workflows. #118

Merged
merged 10 commits into from
Sep 16, 2022
2 changes: 1 addition & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
backport:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
permissions:
contents: write
pull-requests: write
Expand Down
4 changes: 3 additions & 1 deletion .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]
MaxKsyunz marked this conversation as resolved.
Show resolved Hide resolved
push:
paths:
- 'bi-connectors/PowerBIConnector/**'
Expand All @@ -9,7 +11,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we need to switch it off of ubuntu-latest?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid any possible troubles when ubuntu-latest would be upgraded. See discussion thread there: #118 (comment).

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Pack Tableau JDBC connector
Expand Down
64 changes: 17 additions & 47 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,40 @@
# 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]+'
- '[1-9]+.[0-9x]+.[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-20.04
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
4 changes: 2 additions & 2 deletions .github/workflows/dco.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Get PR Commits
Expand All @@ -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 }}
acarbonetto marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion .github/workflows/delete_backport_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
delete-branch:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
if: startsWith(github.event.pull_request.head.ref,'backport/')
steps:
- name: Delete merged branch
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/draft-release-notes-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: Release Drafter

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

jobs:
update_release_draft:
name: Update draft release notes
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
# Drafts your next Release notes as Pull Requests are merged into "develop"
- name: Update draft release notes
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
name: Link Checker

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [opened, reopened]
push:
branches:
- 'main'
- '[1-9]+.[0-9x]+'
- '[1-9]+.[0-9x]+.[0-9x]+'
paths:
- '**/*.pdf'
- '**/*.pnj'
- '**/*.jpg'
- '**/*.json'
- '**/*.md'
- '**/*.txt'
- '**/*.rst'

jobs:
linkchecker:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand Down
71 changes: 0 additions & 71 deletions .github/workflows/sql-cli-release-workflow.yml

This file was deleted.

42 changes: 21 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,33 @@
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
runs-on: ubuntu-20.04
defaults:
run:
working-directory: sql-cli
strategy:
matrix:
python-version: [3.8]
opensearch-version: [ 2.2.1 ]

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 +37,17 @@ 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: |
wget -q https://artifacts.opensearch.org/releases/bundle/opensearch/${{ matrix.opensearch-version }}/opensearch-${{ matrix.opensearch-version }}-linux-x64.tar.gz
tar xf opensearch-${{ matrix.opensearch-version }}-linux-x64.tar.gz
opensearch-${{ matrix.opensearch-version }}/bin/opensearch-plugin remove opensearch-security
opensearch-${{ matrix.opensearch-version }}/bin/opensearch -d

- 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 +57,7 @@ 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
49 changes: 0 additions & 49 deletions .github/workflows/sql-jdbc-push-jdbc-maven.yml

This file was deleted.

Loading