Skip to content

Commit

Permalink
ci: Add nightly tests (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiurin authored Jul 22, 2024
1 parent 6816d08 commit 98d7f18
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jaffle-shop-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
account: "automation"
account: ${{ vars.FIREBOLT_ACCOUNT }}
api-endpoint: "api.staging.firebolt.io"


Expand All @@ -49,7 +49,7 @@ jobs:
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
API_ENDPOINT: "api.staging.firebolt.io"
ACCOUNT_NAME: "automation"
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }}
DBT_PROFILES_DIR: "../dbt-firebolt/.github/workflows/jaffle_shop"
working-directory: jaffle-shop
run:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/jaffle_shop/run_test_workflow.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/bash
set -e
dbt debug
dbt clean
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Nightly code check
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *' # 3 am UTC every day
jobs:
code-check:
uses: ./.github/workflows/code-check.yml
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.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Check out dbt-adapter code
uses: actions/checkout@v4
with:
path: dbt-firebolt

- name: Check out Jaffle Shop code
uses: actions/checkout@v4
with:
repository: firebolt-db/jaffle_shop_firebolt
path: jaffle-shop

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e "dbt-firebolt/.[dev]"
- name: Setup database and engine
id: setup
uses: firebolt-db/integration-testing-setup@v2
with:
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
account: ${{ vars.FIREBOLT_ACCOUNT }}
api-endpoint: "api.staging.firebolt.io"

- name: Run Jaffle Shop test workflow
env:
USER_NAME: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
PASSWORD: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
API_ENDPOINT: "api.staging.firebolt.io"
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }}
DBT_PROFILES_DIR: "../dbt-firebolt/.github/workflows/jaffle_shop"
working-directory: jaffle-shop
shell: bash
run: |
../dbt-firebolt/.github/workflows/jaffle_shop/run_test_workflow.sh
- 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 }}

0 comments on commit 98d7f18

Please sign in to comment.