diff --git a/.github/file-paths.yaml b/.github/file-paths.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c7d90727b021b506f4576f8280333cc2782db275 --- /dev/null +++ b/.github/file-paths.yaml @@ -0,0 +1,88 @@ +default: &default + - "locales/**" + - "bin/**" + +ci: &ci + - ".github/**" + +shared_sources: &shared_sources + - "shared/src" + +shared_specs: &shared_specs + - "shared/test" + +frontend_sources: &frontend_sources + - *shared_sources + - "frontend/**" + - "enterprise/frontend/**" + - "frontend/!(test)/**" + - "yarn.lock" + - "**/tsconfig*.json" + - "package.json" + - "babel.config.json" + - "postcss.config.js" + - "webpack.config.js" + - "webpack.static-viz.config.js" + +frontend_specs: &frontend_specs + - *shared_specs + - "frontend/test/!(__support__|__runner__)/**" + - "frontend/**.unit.*" + - "jest.config.js" + +frontend_all: &frontend_all + - *ci + - *frontend_sources + - *frontend_specs + +backend_presto_kerberos: + - "**/presto_jdbc/**" + - "**/presto_jdbc.clj" + +backend_sources: &backend_sources + - *shared_sources + - "**deps.edn" + - "enterprise/backend/src/**" + - "src/**" + - "modules/drivers/{*,*/{*,!(test)/**}}" + - "resources/**" + - ".clj-kondo/**" + +backend_specs: &backend_specs + - *shared_specs + - "test/**" + - "enterprise/backend/test/**" + - "test_modules/**" + - "modules/drivers/*/test/**" + - "test_config/**" + - "dev/**" + +backend_all: &backend_all + - *default + - *ci + - *backend_sources + - *backend_specs + - *frontend_sources # keep it here until we detect static viz changes + +sources: &sources + - *frontend_sources + - *backend_sources + +e2e_specs: &e2e_specs + - "**.cy.*.js" + - "frontend/test/__support__/e2e/**" + - "frontend/test/__runner__/*cypress*" + +e2e_all: + - *default + - *ci + - *e2e_specs + - *sources + +snowplow: + - *ci + - "snowplow/**" + +documentation: + - "docs/**" + - "**.md" diff --git a/.github/workflows/frontend-skipped-checks.yml b/.github/workflows/frontend-skipped-checks.yml deleted file mode 100644 index 76a40c5e32b98076a94ff59d02937a7d451fc6e6..0000000000000000000000000000000000000000 --- a/.github/workflows/frontend-skipped-checks.yml +++ /dev/null @@ -1,79 +0,0 @@ -# Required checks with path filtering rules will block pull requests from merging if they change only the excluded files. -# This is a workaround to allow the PR to be merged. -# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks -name: Frontend - -on: - push: - branches: - - 'master' - - 'release-**' - paths: - # documentation - - "docs/**" - - "**.md" - # backend - - "enterprise/backend/**" - - "src/**" - - "test/**" - - "*modules/**" # modules/, test_modules/ - # E2E - - "**.cy.*.js" # .cy.spec.js, .cy.snap.js - - "frontend/test/__support__/e2e/**" - - "frontend/test/__runner__/*cypress*" - pull_request: - paths: - # documentation - - "docs/**" - - "**.md" - # backend - - "enterprise/backend/**" - - "src/**" - - "test/**" - - "*modules/**" # modules/, test_modules/ - # E2E - - "**.cy.*.js" # .cy.spec.js, .cy.snap.js - - "frontend/test/__support__/e2e/**" - - "frontend/test/__runner__/*cypress*" - -jobs: - fe-linter-prettier: - runs-on: ubuntu-20.04 - timeout-minutes: 10 - steps: - - run: | - echo "Didn't run due to conditional filtering" - - fe-linter-eslint: - runs-on: ubuntu-20.04 - timeout-minutes: 20 - steps: - - run: | - echo "Didn't run due to conditional filtering" - - fe-type-check: - runs-on: ubuntu-20.04 - timeout-minutes: 10 - steps: - - run: | - echo "Didn't run due to conditional filtering" - - fe-tests-unit: - runs-on: ubuntu-20.04 - timeout-minutes: 20 - steps: - - run: | - echo "Didn't run due to conditional filtering" - - fe-tests-timezones: - runs-on: ubuntu-20.04 - timeout-minutes: 14 - steps: - - run: | - echo "Didn't run due to conditional filtering" - - fe-chromatic: - runs-on: ubuntu-20.04 - steps: - - run: | - echo "Didn't run due to conditional filtering" diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index efe7b84c70b7a5a9efe8da94265de26a5aa6116d..114f8204ee0f27ab17f37ce5a0fd94fa861993dc 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -5,37 +5,28 @@ on: branches: - 'master' - 'release-**' - paths-ignore: - # documentation - - "docs/**" - - "**.md" - # backend - - "enterprise/backend/**" - - "src/**" - - "test/**" - - "*modules/**" # modules/, test_modules/ - # E2E - - "**.cy.*.js" # .cy.spec.js, .cy.snap.js - - "frontend/test/__support__/e2e/**" - - "frontend/test/__runner__/*cypress*" pull_request: types: [opened, synchronize, reopened, ready_for_review] - paths-ignore: - # documentation - - "docs/**" - - "**.md" - # backend - - "enterprise/backend/**" - - "src/**" - - "test/**" - - "*modules/**" # modules/, test_modules/ - # E2E - - "**.cy.*.js" # .cy.spec.js, .cy.snap.js - - "frontend/test/__support__/e2e/**" - - "frontend/test/__runner__/*cypress*" jobs: + files-changed: + name: Check which files changed + runs-on: ubuntu-20.04 + timeout-minutes: 3 + outputs: + frontend_all: ${{ steps.changes.outputs.frontend_all }} + steps: + - uses: actions/checkout@v3 + - name: Test which files changed + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-paths.yaml + fe-linter-prettier: + needs: files-changed + if: needs.files-changed.outputs.frontend_all == 'true' runs-on: ubuntu-20.04 timeout-minutes: 10 steps: @@ -46,6 +37,8 @@ jobs: name: Run Prettier formatting linter fe-linter-eslint: + needs: files-changed + if: needs.files-changed.outputs.frontend_all == 'true' runs-on: ubuntu-20.04 timeout-minutes: 20 steps: @@ -60,6 +53,8 @@ jobs: name: Run ESLint linter fe-type-check: + needs: files-changed + if: needs.files-changed.outputs.frontend_all == 'true' runs-on: ubuntu-20.04 timeout-minutes: 10 steps: @@ -76,7 +71,8 @@ jobs: name: Check types fe-tests-unit: - if: github.event.pull_request.draft == false + needs: files-changed + if: github.event.pull_request.draft == false && needs.files-changed.outputs.frontend_all == 'true' runs-on: buildjet-2vcpu-ubuntu-2004 timeout-minutes: 20 steps: @@ -96,7 +92,8 @@ jobs: flags: front-end fe-tests-timezones: - if: github.event.pull_request.draft == false + needs: files-changed + if: github.event.pull_request.draft == false && needs.files-changed.outputs.frontend_all == 'true' runs-on: ubuntu-20.04 timeout-minutes: 14 steps: @@ -111,7 +108,8 @@ jobs: name: Run frontend timezones tests fe-chromatic: - if: github.event.pull_request.draft == false + needs: files-changed + if: github.event.pull_request.draft == false && needs.files-changed.outputs.frontend_all == 'true' runs-on: ubuntu-20.04 steps: - name: Checkout repository diff --git a/.github/workflows/presto-kerberos-integration-test-skipped-checks.yml b/.github/workflows/presto-kerberos-integration-test-skipped-checks.yml deleted file mode 100644 index 7ab325ad8e0d4da35549d0b0087ac3b8be25f004..0000000000000000000000000000000000000000 --- a/.github/workflows/presto-kerberos-integration-test-skipped-checks.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Required checks with path filtering rules will block pull requests from merging if they change only the excluded files. -# This is a workaround to allow the PR to be merged. -# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks -name: Kerberized Presto Integration Test - -on: - pull_request: - paths-ignore: - - '**/presto_jdbc/**' - - '**/presto_jdbc.clj' - push: - branches: - - 'feature**' - paths-ignore: - - '**/presto_jdbc/**' - - '**/presto_jdbc.clj' - -jobs: - run-presto-kerberos-test: - runs-on: ubuntu-latest - steps: - - run: | - echo "Didn't run due to conditional filtering" diff --git a/.github/workflows/presto-kerberos-integration-test.yml b/.github/workflows/presto-kerberos-integration-test.yml index c80eb02a66e38792ffdd0fc2293299b9505cc6cf..46c581a3b7f19a97c7c4b71aded17430d0f161d6 100644 --- a/.github/workflows/presto-kerberos-integration-test.yml +++ b/.github/workflows/presto-kerberos-integration-test.yml @@ -2,9 +2,6 @@ name: Kerberized Presto Integration Test on: pull_request: - paths: - - '**/presto_jdbc/**' - - '**/presto_jdbc.clj' push: branches: - master @@ -12,12 +9,26 @@ on: - 'feature**' tags: - '**' - paths: - - '**/presto_jdbc/**' - - '**/presto_jdbc.clj' jobs: + files-changed: + name: Check which files changed + runs-on: ubuntu-20.04 + timeout-minutes: 3 + outputs: + backend_presto_kerberos: ${{ steps.changes.outputs.backend_presto_kerberos }} + steps: + - uses: actions/checkout@v3 + - name: Test which files changed + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-paths.yaml + run-presto-kerberos-test: + needs: files-changed + if: needs.files-changed.outputs.backend_presto_kerberos == 'true' runs-on: ubuntu-20.04 timeout-minutes: 40 steps: diff --git a/.github/workflows/snowplow-skipped-checks.yml b/.github/workflows/snowplow-skipped-checks.yml deleted file mode 100644 index 1db3286fbc5670c639cef38f8ace8e633c6b9630..0000000000000000000000000000000000000000 --- a/.github/workflows/snowplow-skipped-checks.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Required checks with path filtering rules will block pull requests from merging if they change only the excluded files. -# This is a workaround to allow the PR to be merged. -# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks -name: Snowplow - -on: - pull_request: - branches: - - "**" - paths-ignore: - - "snowplow/**" - - ".github/workflows/**" - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - run: | - echo "Didn't run due to conditional filtering" diff --git a/.github/workflows/snowplow.yml b/.github/workflows/snowplow.yml index 9d505e78d667caad544fb13dc0d7c120658492ef..db40125274e654a422e9dda290fec508ace6ed9e 100644 --- a/.github/workflows/snowplow.yml +++ b/.github/workflows/snowplow.yml @@ -4,12 +4,26 @@ on: pull_request: branches: - '**' - paths: - - 'snowplow/**' - - '.github/workflows/**' jobs: + files-changed: + name: Check which files changed + runs-on: ubuntu-20.04 + timeout-minutes: 3 + outputs: + snowplow: ${{ steps.changes.outputs.snowplow }} + steps: + - uses: actions/checkout@v3 + - name: Test which files changed + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-paths.yaml + lint: + needs: files-changed + if: needs.files-changed.outputs.snowplow == 'true' runs-on: ubuntu-20.04 steps: - name: Checkout