From 2d1bcd253b7b3110a60ab8e60544d2fce990a9a2 Mon Sep 17 00:00:00 2001 From: Marcelo Grebois Date: Thu, 9 May 2024 17:15:38 +0200 Subject: [PATCH] Adding sql lint test --- .github/workflows/frontend-test.yml | 76 ++++++++++++++--------------- .github/workflows/sqlfluff.yml | 26 ++++++++++ 2 files changed, 64 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/sqlfluff.yml diff --git a/.github/workflows/frontend-test.yml b/.github/workflows/frontend-test.yml index 090e6c5e..30eecf37 100644 --- a/.github/workflows/frontend-test.yml +++ b/.github/workflows/frontend-test.yml @@ -1,38 +1,38 @@ -name: frontend-tests - -on: - push: - branches: - - development - pull_request: - branches: - - development -jobs: - frontend-tests: - name: Run Frontend Tests - runs-on: ubuntu-latest -# if: | -# contains(github.event.pull_request.changed_files, 'web/') - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '22' - - - name: Install Node dependencies - run: | - cd web - npm install - - - name: Run Jest tests - run: | - cd web - npm run test:jest - - - name: Run Cypress tests - run: | - cd web - npm run test:cypress +#name: frontend-tests +# +#on: +# push: +# branches: +# - development +# pull_request: +# branches: +# - development +#jobs: +# frontend-tests: +# name: Run Frontend Tests +# runs-on: ubuntu-latest +## if: | +## contains(github.event.pull_request.changed_files, 'web/') +# steps: +# - name: Checkout code +# uses: actions/checkout@v3 +# +# - name: Set up Node.js +# uses: actions/setup-node@v3 +# with: +# node-version: '22' +# +# - name: Install Node dependencies +# run: | +# cd web +# npm install +# +# - name: Run Jest tests +# run: | +# cd web +# npm run test:jest +# +# - name: Run Cypress tests +# run: | +# cd web +# npm run test:cypress diff --git a/.github/workflows/sqlfluff.yml b/.github/workflows/sqlfluff.yml new file mode 100644 index 00000000..da597ce8 --- /dev/null +++ b/.github/workflows/sqlfluff.yml @@ -0,0 +1,26 @@ +name: sqlfluff + +on: + push: + branches: + - development + pull_request: + branches: + - development + +jobs: + sqlfluff: + name: sqlfluff + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: yu-iskw/action-sqlfluff@v3 + id: lint-sql + with: + github_token: ${{ secrets.github_token }} + paths: '${{ github.workspace }}/db/migrations' + - name: 'Show outputs (Optional)' + shell: bash + run: | + echo '${{ steps.lint-sql.outputs.sqlfluff-results }}' | jq -r '.' + echo '${{ steps.lint-sql.outputs.sqlfluff-results-rdjson }}' | jq -r '.'