fix: improve change detection for GHAs (#27904)

This commit is contained in:
Maxime Beauchemin
2024-04-08 16:20:25 -07:00
committed by GitHub
parent 7c8e1bb46e
commit e80d194b8f
16 changed files with 338 additions and 331 deletions

View File

@@ -6,12 +6,8 @@ on:
branches:
- "master"
- "[0-9].[0-9]"
paths:
- "superset/**"
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
paths:
- "superset/**"
# cancel previous workflow jobs for PRs
concurrency:
@@ -59,30 +55,30 @@ jobs:
with:
persist-credentials: false
submodules: recursive
- name: Check if python changes are present
- name: Check for file changes
id: check
env:
GITHUB_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
continue-on-error: true
run: ./scripts/ci_check_no_file_changes.sh python
uses: ./.github/actions/change-detector/
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: ./.github/actions/setup-backend/
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python == 'true'
- name: Setup Postgres
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
uses: ./.github/actions/cached-dependencies
with:
run: setup-postgres
run: |
echo "${{ steps.check.outputs.python }}"
setup-postgres
- name: Run celery
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
- name: Python unit tests (PostgreSQL)
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
run: |
./scripts/python_tests.sh -m 'chart_data_flow or sql_json_flow'
- name: Upload code coverage
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
run: |
bash .github/workflows/codecov.sh -c -F python -F presto
@@ -118,38 +114,36 @@ jobs:
with:
persist-credentials: false
submodules: recursive
- name: Check if python changes are present
- name: Check for file changes
id: check
env:
GITHUB_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
continue-on-error: true
run: ./scripts/ci_check_no_file_changes.sh python
uses: ./.github/actions/change-detector/
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create csv upload directory
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
run: sudo mkdir -p /tmp/.superset/uploads
- name: Give write access to the csv upload directory
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
run: sudo chown -R $USER:$USER /tmp/.superset
- name: Start hadoop and hive
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
run: docker compose -f scripts/databases/hive/docker-compose.yml up -d
- name: Setup Python
uses: ./.github/actions/setup-backend/
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
- name: Setup Postgres
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
uses: ./.github/actions/cached-dependencies
with:
run: setup-postgres
- name: Run celery
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
- name: Python unit tests (PostgreSQL)
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
run: |
./scripts/python_tests.sh -m 'chart_data_flow or sql_json_flow'
- name: Upload code coverage
if: steps.check.outcome == 'failure'
if: steps.check.outputs.python
run: |
bash .github/workflows/codecov.sh -c -F python -F hive