Skip to content

Commit

Permalink
Remove sqlfluff CI
Browse files Browse the repository at this point in the history
  • Loading branch information
NiallRees committed Jan 31, 2025
1 parent 75e1cae commit 66ab76f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 75 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/ci_test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,64 +39,3 @@ jobs:

- name: Run Snowflake Tests
run: tox -e snowflake

sqlfluff-lint-models:
name: Lint dbt models using SQLFluff
runs-on: ubuntu-latest
environment:
name: Approve Integration Tests

steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR

- name: Install Python packages
run: python -m pip install dbt-snowflake~=1.9.0 sqlfluff-templater-dbt

- name: Test database connection
run: dbt debug

- name: Install dbt packages
run: dbt deps

- name: Get changed files
id: get_file_changes
uses: trilom/[email protected]
with:
output: ' '

- name: Get new and changed .sql files in /models to lint
id: get_files_to_lint
shell: bash -l {0}
run: |
# Set the command in the $() brackets as an output to use in later steps
echo "::set-output name=lintees::$(
# Issue where grep regular expressions don't work as expected on the
# Github Actions shell, check dbt/models/ folder
echo \
$(echo ${{ steps.get_file_changes.outputs.files_modified }} |
tr -s ' ' '\n' |
grep -E '^models.*[.]sql$' |
tr -s '\n' ' ') \
$(echo ${{ steps.get_file_changes.outputs.files_added }} |
tr -s ' ' '\n' |
grep -E '^models.*[.]sql$' |
tr -s '\n' ' ')
)"
- name: Lint dbt models
if: steps.get_files_to_lint.outputs.lintees != ''
shell: bash -l {0}
run: |
sqlfluff lint --format github-annotation --annotation-level failure --nofail ${{ steps.get_files_to_lint.outputs.lintees }} > annotations.json
sed -i '/^\[/!d' annotations.json # see https://github.com/sqlfluff/sqlfluff/issues/2244
- name: Annotate
uses: yuzutech/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
title: "SQLFluff Lint"
input: "./annotations.json"

14 changes: 0 additions & 14 deletions .github/workflows/main_test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,3 @@ jobs:

- name: Run Snowflake Tests
run: tox -e snowflake

sqlfluff-lint-models:
name: Lint dbt models using SQLFluff
runs-on: ubuntu-latest

steps:
- name: Checkout branch
uses: actions/checkout@v2

- name: Install tox
run: python3 -m pip install tox

- name: Lint dbt models
run: tox -e lint_all
6 changes: 6 additions & 0 deletions package-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
packages:
- package: dbt-labs/dbt_utils
version: 1.3.0
- package: get-select/dbt_snowflake_query_tags
version: 2.5.0
sha1_hash: 8f7dc6c807de3c3e5483e9f286aae43e4b7d7bc1

0 comments on commit 66ab76f

Please sign in to comment.