-
Notifications
You must be signed in to change notification settings - Fork 141
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. #837
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: [pull_request] | |
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Get PR Commits | ||
|
@@ -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 }} |
This file was deleted.
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, latest ] | ||
dai-chen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 }} | ||
|
||
|
@@ -28,26 +37,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 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it may not work. e.g, currently, SQL plugin depend on OpenSearch 2.4. But OpenSearch 2.4 Docker Images is not released yet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently, there are only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be worthwhile the next time someone has a chance. |
||
|
||
- 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 | ||
|
||
|
@@ -57,7 +61,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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about that, do we have any known issue regarding to ubuntu-latest. Any reason change to 20.04?
I think opensearch-project use ubuntu-latest by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, follow these 2 links or see TLDR section
Bit-Quill#118 (comment)
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
TL;DR
ubuntu-latest
=ubuntu-20.04
now, but subject to change