From 591c7ab1001ada8b340a8a8ba4ee0c3a67703aeb Mon Sep 17 00:00:00 2001 From: James McNeill Date: Sat, 23 Jul 2022 21:04:56 +0100 Subject: [PATCH] add new lint ci job --- .github/workflows/ci.yml | 22 ++++++++++++++++--- README.md | 3 ++- ...requirements.txt => requirements-lint.txt} | 1 - integration_tests/requirements-test.txt | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) rename integration_tests/{requirements.txt => requirements-lint.txt} (69%) create mode 100644 integration_tests/requirements-test.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd527be..144b80a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,9 @@ defaults: working-directory: integration_tests on: [push] jobs: - build: + test: runs-on: ubuntu-latest - name: Build + name: Test services: postgres: image: postgres:14.0-alpine @@ -28,10 +28,26 @@ jobs: - name: Setup python venv uses: syphar/restore-virtualenv@v1 - name: Install dbt - run: pip install -r requirements.txt + run: pip install -r requirements-test.txt - name: Run dbt deps run: dbt deps - name: Run dbt seed run: dbt seed --profiles-dir ci_profiles - name: Run dbt models & tests run: dbt build -s dbt_graph_theory_integration_tests --profiles-dir ci_profiles + lint: + runs-on: ubuntu-latest + name: Lint + steps: + - name: Checkout source + uses: actions/checkout@v3 + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Setup python venv + uses: syphar/restore-virtualenv@v1 + - name: Install sqlfluff + run: pip install -r requirements-lint.txt + - name: Run sqlfluff + run: sqlfluff lint diff --git a/README.md b/README.md index 74f93f9..ed0b156 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,8 @@ To set up a python3 virtual environment, run the following in order from the `in ``` python3 -m venv ci_venv source ci_venv/bin/activate -pip install -r requirements.txt +pip install -r requirements-test.txt +pip install -r requirements-lint.txt ``` To exit the virtual environment, simply run: diff --git a/integration_tests/requirements.txt b/integration_tests/requirements-lint.txt similarity index 69% rename from integration_tests/requirements.txt rename to integration_tests/requirements-lint.txt index 117a6ce..76f6523 100644 --- a/integration_tests/requirements.txt +++ b/integration_tests/requirements-lint.txt @@ -1,3 +1,2 @@ -dbt-postgres==1.1.1 sqlfluff==1.2.1 sqlfluff-templater-dbt==1.2.1 diff --git a/integration_tests/requirements-test.txt b/integration_tests/requirements-test.txt new file mode 100644 index 0000000..1c2061f --- /dev/null +++ b/integration_tests/requirements-test.txt @@ -0,0 +1 @@ +dbt-postgres==1.1.1