|
| 1 | +name: Setup PR Validations |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
| 10 | +jobs: |
| 11 | + filter: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + outputs: |
| 14 | + validate_bqetl: ${{ steps.bqetl_files.outputs.any_changed }} |
| 15 | + validate_sql: ${{ steps.sql_files.outputs.any_changed }} |
| 16 | + validate_routines: ${{ steps.routines_files.outputs.any_changed }} |
| 17 | + trigger_sql_generation: ${{ steps.sql_gen_files.outputs.any_changed }} |
| 18 | + steps: |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + persist-credentials: false |
| 24 | + |
| 25 | + - name: Get changed bqetl files |
| 26 | + id: bqetl_files |
| 27 | + uses: tj-actions/changed-files@v44 |
| 28 | + with: |
| 29 | + files: | |
| 30 | + requirements.txt |
| 31 | + bigquery_etl/** |
| 32 | + tests/** |
| 33 | + script/bqetl |
| 34 | + script/entrypoint |
| 35 | + .circleci/** |
| 36 | +
|
| 37 | + - name: Get changed sql files |
| 38 | + id: sql_files |
| 39 | + uses: tj-actions/changed-files@v44 |
| 40 | + with: |
| 41 | + files: | |
| 42 | + requirements.txt |
| 43 | + bigquery_etl/query_scheduling/** |
| 44 | + sql/** |
| 45 | + sql_generators/** |
| 46 | + tests/sql/** |
| 47 | + bqetl_project.yaml |
| 48 | + dags.yaml |
| 49 | + .circleci/** |
| 50 | +
|
| 51 | + - name: Get changed routines files |
| 52 | + id: routines_files |
| 53 | + uses: tj-actions/changed-files@v44 |
| 54 | + with: |
| 55 | + files: | |
| 56 | + requirements.txt |
| 57 | + bigquery_etl/routine/** |
| 58 | + sql/mozfun/** |
| 59 | + sql/moz-fx-data-shared-prod/udf/** |
| 60 | + sql/moz-fx-data-shared-prod/udf_js/** |
| 61 | + bqetl_project.yaml |
| 62 | + .circleci/** |
| 63 | +
|
| 64 | + - name: Get changed sql-generation files |
| 65 | + id: sql_gen_files |
| 66 | + uses: tj-actions/changed-files@v44 |
| 67 | + with: |
| 68 | + files: | |
| 69 | + requirements.txt |
| 70 | + bqetl_project.yaml |
| 71 | +
|
| 72 | + validate-bqetl: |
| 73 | + needs: filter |
| 74 | + if: needs.filter.outputs.validate_bqetl == 'true' |
| 75 | + uses: ./.github/workflows/validate-bqetl.yml |
| 76 | + secrets: inherit |
| 77 | + |
| 78 | + validate-sql: |
| 79 | + needs: filter |
| 80 | + if: needs.filter.outputs.validate_sql == 'true' |
| 81 | + uses: ./.github/workflows/validate-sql.yml |
| 82 | + secrets: inherit |
| 83 | + |
| 84 | + validate-routines: |
| 85 | + needs: filter |
| 86 | + if: needs.filter.outputs.validate_routines == 'true' |
| 87 | + uses: ./.github/workflows/validate-routines.yml |
| 88 | + secrets: inherit |
| 89 | + |
| 90 | + trigger-sql-generation: |
| 91 | + needs: filter |
| 92 | + if: needs.filter.outputs.trigger_sql_generation == 'true' |
| 93 | + uses: ./.github/workflows/trigger-sql-generation.yml |
| 94 | + secrets: inherit |
0 commit comments