Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ name: Code quality checks

on:
workflow_call:
inputs:
branch:
required: false
type: string
description: 'Branch to run on'
push:
branches: [ main ]
branches: [ main, 0.x ]

jobs:
check-code:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}

- name: Set up Python 3.8
uses: actions/setup-python@v2
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Integration tests
on:
workflow_dispatch:
workflow_call:
inputs:
branch:
required: false
type: string
description: 'Branch to run on'
secrets:
FIREBOLT_USERNAME:
required: true
Expand All @@ -17,6 +22,8 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}

- name: Set up Python 3.7
uses: actions/setup-python@v2
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/nightly-v0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: v0.x Nightly code check
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *' # 3 am UTC every day
jobs:
code-check:
uses: ./.github/workflows/nightly-workflow.yml
with:
branch: 0.x
91 changes: 91 additions & 0 deletions .github/workflows/nightly-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Nightly workflow
on:
workflow_call:
inputs:
branch:
required: true
type: string
description: 'Branch to run on'
jobs:
code-check:
uses: ./.github/workflows/code-check.yml
with:
branch: ${{ inputs.branch }}
unit-tests:
uses: ./.github/workflows/unit-tests.yml
with:
branch: ${{ inputs.branch }}
secrets:
GIST_PAT: ${{ secrets.GIST_PAT }}
security-scan:
needs: [unit-tests]
uses: ./.github/workflows/security-scan.yml
with:
branch: ${{ inputs.branch }}
secrets:
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # finish all jobs even if one fails
max-parallel: 2
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]"

- name: Unit test with pytest
run: |
pytest tests/unit

- name: Setup database and engine
id: setup
uses: firebolt-db/integration-testing-setup@master
with:
firebolt-username: ${{ secrets.FIREBOLT_STG_USERNAME }}
firebolt-password: ${{ secrets.FIREBOLT_STG_PASSWORD }}
api-endpoint: "api.staging.firebolt.io"
region: "us-east-1"
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}

- name: Run integration tests
env:
USER_NAME: ${{ secrets.FIREBOLT_STG_USERNAME }}
PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }}
SERVICE_ID: ${{ secrets.SERVICE_ID_STG }}
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET_STG }}
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
ACCOUNT_NAME: "firebolt"
API_ENDPOINT: "api.staging.firebolt.io"
run: |
pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=INFO tests/integration

- name: Slack Notify of failure
if: failure()
id: slack
uses: firebolt-db/action-slack-nightly-notify@v1
with:
os: ${{ matrix.os }}
programming-language: Python
language-version: ${{ matrix.python-version }}
notifications-channel: 'ecosystem-ci-notifications'
slack-api-key: ${{ secrets.SLACK_BOT_TOKEN }}
76 changes: 3 additions & 73 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,6 @@ on:
- cron: '0 3 * * *' # 3 am UTC every day
jobs:
code-check:
uses: ./.github/workflows/code-check.yml
unit-tests:
uses: ./.github/workflows/unit-tests.yml
secrets:
GIST_PAT: ${{ secrets.GIST_PAT }}
security-scan:
needs: [unit-tests]
uses: ./.github/workflows/security-scan.yml
secrets:
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # finish all jobs even if one fails
max-parallel: 2
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Check out code
uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]"

- name: Unit test with pytest
run: |
pytest tests/unit

- name: Setup database and engine
id: setup
uses: firebolt-db/integration-testing-setup@master
with:
firebolt-username: ${{ secrets.FIREBOLT_STG_USERNAME }}
firebolt-password: ${{ secrets.FIREBOLT_STG_PASSWORD }}
api-endpoint: "api.staging.firebolt.io"
region: "us-east-1"
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}

- name: Run integration tests
env:
USER_NAME: ${{ secrets.FIREBOLT_STG_USERNAME }}
PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }}
SERVICE_ID: ${{ secrets.SERVICE_ID_STG }}
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET_STG }}
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
ACCOUNT_NAME: "firebolt"
API_ENDPOINT: "api.staging.firebolt.io"
run: |
pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=INFO tests/integration

- name: Slack Notify of failure
if: failure()
id: slack
uses: firebolt-db/action-slack-nightly-notify@v1
with:
os: ${{ matrix.os }}
programming-language: Python
language-version: ${{ matrix.python-version }}
notifications-channel: 'ecosystem-ci-notifications'
slack-api-key: ${{ secrets.SLACK_BOT_TOKEN }}
uses: ./.github/workflows/nightly-workflow.yml
with:
branch: main
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pull request

on:
pull_request:
branches: [ main ]
branches: [ main, 0.x ]

jobs:
check-title:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/release-v0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: v0.x Release new version

on:
workflow_dispatch:
inputs:
pre-release-tag:
required: false
description: 'Tag for pre-release (optional)'
major-release:
required: false
description: 'Trigger a major release (optional). Leave empty for regular release.'

jobs:
integration-tests:
uses: ./.github/workflows/integration-tests.yml
with:
branch: 0.x
secrets:
FIREBOLT_USERNAME: ${{ secrets.FIREBOLT_USERNAME }}
FIREBOLT_PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
SERVICE_ID: ${{ secrets.SERVICE_ID }}
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}

publish:
runs-on: ubuntu-latest
permissions:
contents: write
needs: integration-tests
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: 0.x
token: ${{ secrets.RELEASE_PAT }}

- name: 'Publish action'
uses: firebolt-db/action-python-release@main
with:
pre-release-tag: ${{ inputs.pre-release-tag }}
major-release: ${{ inputs.major-release }}
pypi-username: ${{ secrets.PYPI_USERNAME }}
pypi-password: ${{ secrets.PYPI_PASSWORD }}
version-file-path: "src/firebolt/__init__.py"
main-branch: 0.x
7 changes: 7 additions & 0 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Firebolt Security Scan
on:
workflow_dispatch:
workflow_call:
inputs:
branch:
required: false
type: string
description: 'Branch to run on'
secrets:
FOSSA_TOKEN:
required: true
Expand All @@ -15,6 +20,8 @@ jobs:
steps:
- name: "Checkout Code"
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}

- name: "Download coverage report"
uses: actions/download-artifact@v2
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ name: Unit tests

on:
workflow_call:
inputs:
branch:
required: false
type: string
description: 'Branch to run on'
secrets:
GIST_PAT:
required: true
push:
branches: [ main ]
branches: [ main, 0.x ]

jobs:
unit-tests:
Expand All @@ -19,6 +24,8 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}

- name: Set up Python 3.7
uses: actions/setup-python@v2
Expand Down