-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regular testing on all platforms
- Loading branch information
1 parent
6595ed7
commit 6964470
Showing
3 changed files
with
116 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Code formatting, linting, type checks and tests on ubuntu-latest and macos-latest | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
- cron: "0 12 * * 1" # every Monday at 12:00 UTC | ||
workflow_dispatch: | ||
|
||
jobs: | ||
code_quality_ubuntu_macos: | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-latest', 'macos-latest'] | ||
python-version: ['3.8', '3.12'] | ||
defaults: | ||
run: | ||
shell: bash | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
- name: Check out code repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Install package with latest version of all dependencies | ||
run: | | ||
poetry update --no-interaction --sync | ||
poetry install --no-interaction --all-extras | ||
- name: Run Black check | ||
run: | | ||
source $VENV | ||
black . --check | ||
- name: Lint with ruff | ||
run: | | ||
source $VENV | ||
ruff check . | ||
- name: Check types with mypy | ||
run: | | ||
source $VENV | ||
mypy . | ||
if: ${{ matrix.python-version == '3.8' }} | ||
- name: Check types with mypy | ||
run: | | ||
source $VENV | ||
mypy . --ignore-missing-imports | ||
if: ${{ matrix.python-version == '3.12' }} | ||
|
||
- name: Run tests | ||
env: | ||
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} | ||
DATABRICKS_HTTP_PATH: ${{ secrets.DATABRICKS_HTTP_PATH }} | ||
DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }} | ||
DATABRICKS_CLIENT_SECRET: ${{ secrets.DATABRICKS_CLIENT_SECRET }} | ||
run: | | ||
source $VENV | ||
pytest -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Tests on windows-latest | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
- cron: "0 12 * * 1" # every Monday at 12:00 UTC | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tests_windows_latest: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest] | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Check out code repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install harlequin-databricks and dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install harlequin databricks-sql-connector databricks-sdk pytest | ||
pip install -e . | ||
- name: Run tests | ||
env: | ||
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} | ||
DATABRICKS_HTTP_PATH: ${{ secrets.DATABRICKS_HTTP_PATH }} | ||
DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }} | ||
DATABRICKS_CLIENT_SECRET: ${{ secrets.DATABRICKS_CLIENT_SECRET }} | ||
run: | | ||
pytest -v |