generated from reviewdog/action-composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 27
84 lines (82 loc) · 2.96 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Test
on:
pull_request:
paths-ignore:
- "**/*.md"
jobs:
test-lint:
name: runner / sqlfluff (github-check)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sqlfluff:
- "3.0.7"
extra_requirements_txt:
- "testdata/test_failed_dbt/extra_requirements-1.6.txt"
- "testdata/test_failed_dbt/extra_requirements-1.7.txt"
- "testdata/test_failed_dbt/extra_requirements-1.8.txt"
config:
- ".sqlfluff.bigquery"
- ".sqlfluff.postgres"
- ".sqlfluff.redshift"
- ".sqlfluff.snowflake"
- ".sqlfluff.spark"
steps:
- uses: actions/checkout@v4
- uses: ./
id: lint-sql
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
sqlfluff_version: ${{ matrix.sqlfluff }}
sqlfluff_command: lint
templater: jinja
working-directory: "${{ github.workspace }}/testdata/test_failed_dbt"
config: "${{ github.workspace }}/testdata/test_failed_dbt/${{ matrix.config }}"
paths: "${{ github.workspace }}/testdata/test_failed_dbt/models"
extra_requirements_txt: "${{ github.workspace }}/${{ matrix.extra_requirements_txt }}"
- name: check the exit code
if: ${{ !success() }}
run: echo 'The previous step should fail' && exit 1
- name: "Test outputs"
if: always()
shell: bash
run: |
echo '${{ steps.lint-sql.outputs.sqlfluff-results }}' | jq -r '.'
echo '${{ steps.lint-sql.outputs.sqlfluff-results-rdjson }}' | jq -r '.'
echo '${{ steps.lint-sql.outputs.sqlfluff-exit-code }}'
echo '${{ steps.lint-sql.outputs.reviewdog-exit-code }}'
test-fix:
needs: ["test-lint"]
name: runner / sqlfluff (test-fix)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sqlfluff:
- "3.0.7"
extra_requirements_txt:
- "testdata/test_failed_dbt/extra_requirements-1.6.txt"
- "testdata/test_failed_dbt/extra_requirements-1.7.txt"
- "testdata/test_failed_dbt/extra_requirements-1.8.txt"
config:
- ".sqlfluff.bigquery"
- ".sqlfluff.postgres"
- ".sqlfluff.redshift"
- ".sqlfluff.snowflake"
- ".sqlfluff.spark"
steps:
- uses: actions/checkout@v4
- uses: ./
id: lint-sql
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
sqlfluff_version: ${{ matrix.sqlfluff }}
sqlfluff_command: fix
templater: jinja
working-directory: "${{ github.workspace }}/testdata/test_failed_dbt"
config: "${{ github.workspace }}/testdata/test_failed_dbt/${{ matrix.config }}"
paths: "${{ github.workspace }}/testdata/test_failed_dbt/models"
extra_requirements_txt: "${{ github.workspace }}/${{ matrix.extra_requirements_txt }}"