Skip to content

Commit

Permalink
Merge pull request #1
Browse files Browse the repository at this point in the history
Add CI workflow for application tests
  • Loading branch information
Bilbottom authored Jan 6, 2024
2 parents 886a455 + cf7bdb3 commit 787a0e7
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Bilbottom
43 changes: 43 additions & 0 deletions .github/workflows/application-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Application Tests
run-name: Application tests 🧪

on:
workflow_dispatch:
pull_request:
paths:
- "dbt_py/**"
- "tests/**"
- poetry.lock
- .pre-commit-config.yaml

jobs:
version-testing:
name: Run tests over multiple OSs
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]

steps:
- name: 🛎️ Check out repository
uses: actions/checkout@v3

- name: 📦 Set up Poetry
run: pipx install poetry==1.7.0

- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: poetry

- name: 🔨 Install dependencies
run: poetry install --with test

- name: ✅ Run unit tests
run: poetry run pytest
env:
# TODO: The tests should configure this themselves
DBT_PY_PACKAGE_ROOT: "tests.integration.jaffle-shop.dbt_py"
DBT_PY_PACKAGE_NAME: "dbt_py"
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
name: Validate Python

- repo: https://github.com/python-poetry/poetry
rev: 1.6.0
rev: 1.7.0
hooks:
- id: poetry-check
name: Check that the Poetry configuration is valid
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Bilbottom

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div align="center">

[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3110/)
[![Python 3.11](https://img.shields.io/badge/dbt-1.5+-blue.svg)](https://github.com/dbt-labs/dbt-core/)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
![GitHub last commit](https://img.shields.io/github/last-commit/Bilbottom/dbt-py)

Expand Down
2 changes: 2 additions & 0 deletions tests/integration/jaffle-shop/dbt-commands.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Just for reference
# $env:DBT_PY_PACKAGE_ROOT = "tests.integration.jaffle-shop.dbt_py"
# $env:DBT_PY_PACKAGE_NAME = "dbt_py"
dbt clean --project-dir tests/integration/jaffle-shop --profiles-dir tests/integration/jaffle-shop --no-clean-project-files-only
dbt-py compile --project-dir tests/integration/jaffle-shop --profiles-dir tests/integration/jaffle-shop
rm dbt_packages

0 comments on commit 787a0e7

Please sign in to comment.