chore: prevent CI double runs on push + pull_request (#26766)
This commit is contained in:
parent
7da56a0744
commit
c6772b6c78
|
|
@ -3,6 +3,12 @@ on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- "superset/migrations/**"
|
- "superset/migrations/**"
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "superset/migrations/**"
|
||||||
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_db_migration_conflict:
|
check_db_migration_conflict:
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,13 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
target: ["dev", "lean", "lean310", "websocket", "dockerize"]
|
target: ["dev", "lean", "lean310", "websocket", "dockerize"]
|
||||||
platform: ["linux/amd64", "linux/arm64"]
|
platform: ["linux/amd64", "linux/arm64"]
|
||||||
|
exclude:
|
||||||
|
# disabling because slow! no python wheels for arm/py39 and
|
||||||
|
# QEMU is slow!
|
||||||
|
- target: "dev"
|
||||||
|
platform: "linux/arm64"
|
||||||
|
- target: "lean"
|
||||||
|
platform: "linux/arm64"
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,10 @@ name: License Check
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/**"
|
- 'master'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
config:
|
config:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
# no-op.yml
|
||||||
|
#
|
||||||
|
# Purpose:
|
||||||
|
# This workflow provides a workaround for the "required status checks" feature in GitHub Actions
|
||||||
|
# when using path-specific conditions in other workflows. Required checks might remain in a "Pending"
|
||||||
|
# state if the conditions are not met, thus blocking pull requests from being merged.
|
||||||
|
# This no-op (no operation) workflow provides dummy success statuses for these required jobs when
|
||||||
|
# the real jobs do not run due to path-specific conditions.
|
||||||
|
#
|
||||||
|
# How it works:
|
||||||
|
# - It defines jobs with the same names as the required jobs in the main workflows.
|
||||||
|
# - These jobs simply execute a command (`exit 0`) to succeed immediately.
|
||||||
|
# - When a pull request is created or updated, both this no-op workflow and the main workflows are triggered.
|
||||||
|
# - If the main workflows' jobs don't run (due to path conditions), these no-op jobs provide successful statuses.
|
||||||
|
# - If the main workflows' jobs do run and fail, their failure statuses take precedence,
|
||||||
|
# ensuring that pull requests are not merged with failing checks.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# - Ensure that the job names in this workflow match exactly the names of the corresponding jobs in the main workflows.
|
||||||
|
# - This workflow should be kept as-is, without path-specific conditions.
|
||||||
|
|
||||||
|
name: No Operation Checks
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
frontend-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: No-op for frontend-build
|
||||||
|
run: |
|
||||||
|
echo "This is a no-op step for frontend-build to ensure a successful status."
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
pre-commit:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.9"]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: No-op for pre-commit
|
||||||
|
run: |
|
||||||
|
echo "This is a no-op step for pre-commit to ensure a successful status."
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
python-lint:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.9"]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: No-op for python-lint
|
||||||
|
run: |
|
||||||
|
echo "This is a no-op step for python-lint to ensure a successful status."
|
||||||
|
exit 0
|
||||||
|
|
@ -2,10 +2,14 @@ name: Prefer TypeScript
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/**"
|
- 'master'
|
||||||
|
paths:
|
||||||
|
- "superset-frontend/src/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
paths:
|
||||||
|
- "superset-frontend/src/**"
|
||||||
jobs:
|
jobs:
|
||||||
prefer_typescript:
|
prefer_typescript:
|
||||||
if: github.ref == 'ref/heads/master' && github.event_name == 'pull_request'
|
if: github.ref == 'ref/heads/master' && github.event_name == 'pull_request'
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ name: Superset CLI tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/npm_and_yarn/**"
|
- 'master'
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, opened, reopened, ready_for_review]
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,12 @@ on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
config:
|
config:
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,8 @@ name: E2E
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/**/docs/**"
|
- 'master'
|
||||||
paths-ignore:
|
|
||||||
- "docs/**"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, opened, reopened, ready_for_review]
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,14 @@ name: Frontend
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/**/docs/**"
|
- "master"
|
||||||
- "dependabot/**/cypress-base/**"
|
paths:
|
||||||
|
- "superset-frontend/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, opened, reopened, ready_for_review]
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
paths:
|
||||||
|
- "superset-frontend/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
frontend-build:
|
frontend-build:
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ name: Lint and Test Charts
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, edited, reopened, synchronize]
|
types: [opened, edited, reopened, synchronize]
|
||||||
|
paths:
|
||||||
|
- "helm/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ name: Python-Integration
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/npm_and_yarn/**"
|
- 'master'
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, opened, reopened, ready_for_review]
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,14 @@ name: Python Misc
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/npm_and_yarn/**"
|
- 'master'
|
||||||
|
paths:
|
||||||
|
- "superset/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, opened, reopened, ready_for_review]
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
paths:
|
||||||
|
- "superset/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
python-lint:
|
python-lint:
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,14 @@ name: Python Presto/Hive
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/npm_and_yarn/**"
|
- 'master'
|
||||||
|
paths:
|
||||||
|
- "superset/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, opened, reopened, ready_for_review]
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
paths:
|
||||||
|
- "superset/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-postgres-presto:
|
test-postgres-presto:
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,14 @@ name: Python-Unit
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/npm_and_yarn/**"
|
- 'master'
|
||||||
|
paths:
|
||||||
|
- "superset/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, opened, reopened, ready_for_review]
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
paths:
|
||||||
|
- "superset/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
unit-tests:
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ name: Translations
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches:
|
||||||
- "dependabot/npm_and_yarn/**"
|
- 'master'
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, opened, reopened, ready_for_review]
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
name: WebSocket server
|
name: WebSocket server
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
paths:
|
paths:
|
||||||
- "superset-websocket/**"
|
- "superset-websocket/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "superset-websocket/**"
|
- "superset-websocket/**"
|
||||||
|
types: [synchronize, opened, reopened, ready_for_review]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
app-checks:
|
app-checks:
|
||||||
|
|
|
||||||
|
|
@ -70,27 +70,31 @@ fi
|
||||||
|
|
||||||
BUILD_ARG="3.9-slim-bookworm"
|
BUILD_ARG="3.9-slim-bookworm"
|
||||||
|
|
||||||
|
# Replace '/' with '-' in BUILD_PLATFORM
|
||||||
|
SAFE_BUILD_PLATFORM=$(echo "${BUILD_PLATFORM}" | sed 's/\//-/g')
|
||||||
|
MAIN_UNIQUE_TAG="${REPO_NAME}:${SHA}-${TARGET}-${SAFE_BUILD_PLATFORM}-${BUILD_ARG}"
|
||||||
|
|
||||||
case "${TARGET}" in
|
case "${TARGET}" in
|
||||||
"dev")
|
"dev")
|
||||||
DOCKER_TAGS="-t ${REPO_NAME}:${SHA}-dev -t ${REPO_NAME}:${REFSPEC}-dev -t ${DEV_TAG}"
|
DOCKER_TAGS="-t ${MAIN_UNIQUE_TAG} -t ${REPO_NAME}:${SHA}-dev -t ${REPO_NAME}:${REFSPEC}-dev -t ${DEV_TAG}"
|
||||||
BUILD_TARGET="dev"
|
BUILD_TARGET="dev"
|
||||||
;;
|
;;
|
||||||
"lean")
|
"lean")
|
||||||
DOCKER_TAGS="-t ${REPO_NAME}:${SHA} -t ${REPO_NAME}:${REFSPEC} -t ${REPO_NAME}:${LATEST_TAG}"
|
DOCKER_TAGS="-t ${MAIN_UNIQUE_TAG} -t ${REPO_NAME}:${SHA} -t ${REPO_NAME}:${REFSPEC} -t ${REPO_NAME}:${LATEST_TAG}"
|
||||||
BUILD_TARGET="lean"
|
BUILD_TARGET="lean"
|
||||||
;;
|
;;
|
||||||
"lean310")
|
"lean310")
|
||||||
DOCKER_TAGS="-t ${REPO_NAME}:${SHA}-py310 -t ${REPO_NAME}:${REFSPEC}-py310 -t ${REPO_NAME}:${LATEST_TAG}-py310"
|
DOCKER_TAGS="-t ${MAIN_UNIQUE_TAG} -t ${REPO_NAME}:${SHA}-py310 -t ${REPO_NAME}:${REFSPEC}-py310 -t ${REPO_NAME}:${LATEST_TAG}-py310"
|
||||||
BUILD_TARGET="lean"
|
BUILD_TARGET="lean"
|
||||||
BUILD_ARG="3.10-slim-bookworm"
|
BUILD_ARG="3.10-slim-bookworm"
|
||||||
;;
|
;;
|
||||||
"websocket")
|
"websocket")
|
||||||
DOCKER_TAGS="-t ${REPO_NAME}:${SHA}-websocket -t ${REPO_NAME}:${REFSPEC}-websocket -t ${REPO_NAME}:${LATEST_TAG}-websocket"
|
DOCKER_TAGS="-t ${MAIN_UNIQUE_TAG} -t ${REPO_NAME}:${SHA}-websocket -t ${REPO_NAME}:${REFSPEC}-websocket -t ${REPO_NAME}:${LATEST_TAG}-websocket"
|
||||||
BUILD_TARGET=""
|
BUILD_TARGET=""
|
||||||
DOCKER_CONTEXT="superset-websocket"
|
DOCKER_CONTEXT="superset-websocket"
|
||||||
;;
|
;;
|
||||||
"dockerize")
|
"dockerize")
|
||||||
DOCKER_TAGS="-t ${REPO_NAME}:dockerize"
|
DOCKER_TAGS="-t ${MAIN_UNIQUE_TAG} -t ${REPO_NAME}:dockerize"
|
||||||
BUILD_TARGET=""
|
BUILD_TARGET=""
|
||||||
DOCKER_CONTEXT="-f dockerize.Dockerfile ."
|
DOCKER_CONTEXT="-f dockerize.Dockerfile ."
|
||||||
;;
|
;;
|
||||||
|
|
@ -102,6 +106,7 @@ esac
|
||||||
|
|
||||||
cat<<EOF
|
cat<<EOF
|
||||||
Rolling with tags:
|
Rolling with tags:
|
||||||
|
- $MAIN_UNIQUE_TAG
|
||||||
- ${REPO_NAME}:${SHA}
|
- ${REPO_NAME}:${SHA}
|
||||||
- ${REPO_NAME}:${REFSPEC}
|
- ${REPO_NAME}:${REFSPEC}
|
||||||
- ${REPO_NAME}:${LATEST_TAG}
|
- ${REPO_NAME}:${LATEST_TAG}
|
||||||
|
|
@ -125,11 +130,14 @@ if [[ -n "${BUILD_TARGET}" ]]; then
|
||||||
TARGET_ARGUMENT="--target ${BUILD_TARGET}"
|
TARGET_ARGUMENT="--target ${BUILD_TARGET}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
CACHE_REF="${REPO_NAME}-cache:${TARGET}-${BUILD_ARG}"
|
||||||
|
CACHE_REF=$(echo "${CACHE_REF}" | tr -d '.')
|
||||||
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
${TARGET_ARGUMENT} \
|
${TARGET_ARGUMENT} \
|
||||||
${DOCKER_ARGS} \
|
${DOCKER_ARGS} \
|
||||||
--cache-from=type=registry,ref=apache/superset:${TARGET} \
|
--cache-from=type=registry,ref=${CACHE_REF} \
|
||||||
--cache-to=type=registry,mode=max,ref=apache/superset:${TARGET} \
|
--cache-to=type=registry,mode=max,ref=${CACHE_REF} \
|
||||||
${DOCKER_TAGS} \
|
${DOCKER_TAGS} \
|
||||||
--platform ${BUILD_PLATFORM} \
|
--platform ${BUILD_PLATFORM} \
|
||||||
--label "sha=${SHA}" \
|
--label "sha=${SHA}" \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue