From b5f4b576d4816e576605bb9d9afd351515beb590 Mon Sep 17 00:00:00 2001 From: FlorentP <35779988+frouioui@users.noreply.github.com> Date: Mon, 25 Jul 2022 16:27:30 +0200 Subject: [PATCH] Skip CI workflows on `push` for pull requests (#10768) * Initial addition of the skip workflow directive in docker_test_cluster_10 Signed-off-by: Florent Poinsard * Changed assertion in skip workflow step Signed-off-by: Florent Poinsard * Use github.event.push.ref to check the event type Signed-off-by: Florent Poinsard * Addition of debug information in the skip ci step Signed-off-by: Florent Poinsard * Addition of debug information in the skip ci step Signed-off-by: Florent Poinsard * Addition of debug information in the skip ci step Signed-off-by: Florent Poinsard * Skip the step based on the skip-workflow step Signed-off-by: Florent Poinsard * Applied the skip-workflow step on all the workflows Signed-off-by: Florent Poinsard * Changed the vtadmin workflows' default directory to root Signed-off-by: Florent Poinsard * Removed unwanted workflow files Signed-off-by: Florent Poinsard * Better bash syntax for regex condition Signed-off-by: Florent Poinsard * Changed skip to use boolean string and use better regex to match the release branch Signed-off-by: Florent Poinsard --- .../check_make_vtadmin_authz_testgen.yml | 22 +++++-- .../check_make_vtadmin_web_proto.yml | 20 ++++-- .github/workflows/cluster_endtoend_12.yml | 24 +++++-- .github/workflows/cluster_endtoend_13.yml | 26 ++++++-- .github/workflows/cluster_endtoend_15.yml | 26 ++++++-- .github/workflows/cluster_endtoend_18.yml | 24 +++++-- .github/workflows/cluster_endtoend_21.yml | 26 ++++++-- .github/workflows/cluster_endtoend_22.yml | 26 ++++++-- .github/workflows/cluster_endtoend_26.yml | 26 ++++++-- ...ter_endtoend_ers_prs_newfeatures_heavy.yml | 26 ++++++-- .../workflows/cluster_endtoend_mysql80.yml | 26 ++++++-- .../cluster_endtoend_mysql_server_vault.yml | 28 +++++--- ...cluster_endtoend_onlineddl_declarative.yml | 26 ++++++-- ...endtoend_onlineddl_declarative_mysql80.yml | 26 ++++++-- .../cluster_endtoend_onlineddl_ghost.yml | 26 ++++++-- ...uster_endtoend_onlineddl_ghost_mysql80.yml | 26 ++++++-- .../cluster_endtoend_onlineddl_revert.yml | 26 ++++++-- ...ster_endtoend_onlineddl_revert_mysql80.yml | 26 ++++++-- .../cluster_endtoend_onlineddl_revertible.yml | 26 ++++++-- ..._endtoend_onlineddl_revertible_mysql80.yml | 26 ++++++-- .../cluster_endtoend_onlineddl_scheduler.yml | 26 ++++++-- ...r_endtoend_onlineddl_scheduler_mysql80.yml | 26 ++++++-- .../cluster_endtoend_onlineddl_singleton.yml | 26 ++++++-- ...r_endtoend_onlineddl_singleton_mysql80.yml | 26 ++++++-- .../cluster_endtoend_onlineddl_vrepl.yml | 26 ++++++-- ...uster_endtoend_onlineddl_vrepl_mysql80.yml | 26 ++++++-- ...luster_endtoend_onlineddl_vrepl_stress.yml | 26 ++++++-- ...ndtoend_onlineddl_vrepl_stress_mysql80.yml | 26 ++++++-- ..._endtoend_onlineddl_vrepl_stress_suite.yml | 26 ++++++-- ...d_onlineddl_vrepl_stress_suite_mysql80.yml | 26 ++++++-- ...cluster_endtoend_onlineddl_vrepl_suite.yml | 26 ++++++-- ...endtoend_onlineddl_vrepl_suite_mysql80.yml | 26 ++++++-- .../cluster_endtoend_schemadiff_vrepl.yml | 26 ++++++-- ...ster_endtoend_schemadiff_vrepl_mysql80.yml | 26 ++++++-- .../cluster_endtoend_tabletmanager_consul.yml | 28 +++++--- ...cluster_endtoend_tabletmanager_tablegc.yml | 26 ++++++-- ...endtoend_tabletmanager_tablegc_mysql80.yml | 26 ++++++-- ...uster_endtoend_tabletmanager_throttler.yml | 26 ++++++-- ..._tabletmanager_throttler_custom_config.yml | 26 ++++++-- ...cluster_endtoend_topo_connection_cache.yml | 26 ++++++-- ...dtoend_vreplication_across_db_versions.yml | 26 ++++++-- .../cluster_endtoend_vreplication_basic.yml | 26 ++++++-- ...luster_endtoend_vreplication_cellalias.yml | 26 ++++++-- ...vreplication_migrate_vdiff2_convert_tz.yml | 26 ++++++-- ...luster_endtoend_vreplication_multicell.yml | 26 ++++++-- .../cluster_endtoend_vreplication_v2.yml | 26 ++++++-- .../cluster_endtoend_vstream_failover.yml | 26 ++++++-- ...r_endtoend_vstream_stoponreshard_false.yml | 26 ++++++-- ...er_endtoend_vstream_stoponreshard_true.yml | 26 ++++++-- ...dtoend_vstream_with_keyspaces_to_watch.yml | 26 ++++++-- .../cluster_endtoend_vtbackup_transform.yml | 26 ++++++-- ..._vtctlbackup_sharded_clustertest_heavy.yml | 26 ++++++-- .../cluster_endtoend_vtgate_concurrentdml.yml | 26 ++++++-- .../cluster_endtoend_vtgate_gen4.yml | 26 ++++++-- .../cluster_endtoend_vtgate_general_heavy.yml | 26 ++++++-- .../cluster_endtoend_vtgate_godriver.yml | 26 ++++++-- .../cluster_endtoend_vtgate_queries.yml | 26 ++++++-- ...cluster_endtoend_vtgate_readafterwrite.yml | 26 ++++++-- .../cluster_endtoend_vtgate_reservedconn.yml | 26 ++++++-- .../cluster_endtoend_vtgate_schema.yml | 26 ++++++-- ...cluster_endtoend_vtgate_schema_tracker.yml | 26 ++++++-- ...dtoend_vtgate_tablet_healthcheck_cache.yml | 26 ++++++-- .../cluster_endtoend_vtgate_topo.yml | 26 ++++++-- .../cluster_endtoend_vtgate_topo_consul.yml | 28 +++++--- .../cluster_endtoend_vtgate_topo_etcd.yml | 26 ++++++-- .../cluster_endtoend_vtgate_transaction.yml | 26 ++++++-- .../cluster_endtoend_vtgate_unsharded.yml | 26 ++++++-- .../cluster_endtoend_vtgate_vindex_heavy.yml | 26 ++++++-- .../cluster_endtoend_vtgate_vschema.yml | 26 ++++++-- .github/workflows/cluster_endtoend_vtorc.yml | 26 ++++++-- .../workflows/cluster_endtoend_vtorc_8.0.yml | 26 ++++++-- .../workflows/cluster_endtoend_xb_backup.yml | 26 ++++++-- .../cluster_endtoend_xb_backup_mysql80.yml | 28 +++++--- .../cluster_endtoend_xb_recovery.yml | 26 ++++++-- .github/workflows/docker_test_cluster_10.yml | 21 ++++-- .github/workflows/docker_test_cluster_25.yml | 20 ++++-- .github/workflows/e2e_race.yml | 22 +++++-- .github/workflows/endtoend.yml | 26 ++++++-- .github/workflows/local_example.yml | 24 +++++-- .github/workflows/region_example.yml | 24 +++++-- .github/workflows/static_checks_etc.yml | 49 +++++++++----- .github/workflows/unit_race.yml | 22 +++++-- .github/workflows/unit_test_mariadb103.yml | 22 +++++-- .github/workflows/unit_test_mysql57.yml | 22 +++++-- .github/workflows/unit_test_mysql80.yml | 22 +++++-- .../upgrade_downgrade_test_backups_e2e.yml | 44 ++++++++----- .../upgrade_downgrade_test_backups_manual.yml | 66 +++++++++++-------- ...e_downgrade_test_query_serving_queries.yml | 45 ++++++++----- ...de_downgrade_test_query_serving_schema.yml | 45 ++++++++----- ...rade_downgrade_test_reparent_old_vtctl.yml | 39 +++++++---- ...e_downgrade_test_reparent_old_vttablet.yml | 39 +++++++---- .github/workflows/vtadmin_web_build.yml | 22 +++++-- .github/workflows/vtadmin_web_lint.yml | 31 +++++---- .github/workflows/vtadmin_web_unit_tests.yml | 22 +++++-- test/templates/cluster_endtoend_test.tpl | 28 +++++--- .../cluster_endtoend_test_docker.tpl | 18 ++++- .../cluster_endtoend_test_mysql80.tpl | 28 +++++--- .../cluster_endtoend_test_self_hosted.tpl | 24 +++++-- test/templates/unit_test.tpl | 22 +++++-- test/templates/unit_test_self_hosted.tpl | 24 +++++-- 100 files changed, 1940 insertions(+), 749 deletions(-) diff --git a/.github/workflows/check_make_vtadmin_authz_testgen.yml b/.github/workflows/check_make_vtadmin_authz_testgen.yml index df301a67893..2174d3e9458 100644 --- a/.github/workflows/check_make_vtadmin_authz_testgen.yml +++ b/.github/workflows/check_make_vtadmin_authz_testgen.yml @@ -6,10 +6,22 @@ jobs: name: Check Make vtadmin_authz_testgen runs-on: ubuntu-latest steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -25,18 +37,18 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 - if: steps.changes.outputs.vtadmin_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.vtadmin_changes == 'true' with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.vtadmin_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.vtadmin_changes == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get dependencies - if: steps.changes.outputs.vtadmin_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.vtadmin_changes == 'true' run: | sudo apt-get update sudo apt-get install -y make unzip g++ etcd curl git wget @@ -45,11 +57,11 @@ jobs: go install golang.org/x/tools/cmd/goimports@latest - name: Run make minimaltools - if: steps.changes.outputs.vtadmin_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.vtadmin_changes == 'true' run: | make minimaltools - name: check_make_vtadmin_authz_testgen - if: steps.changes.outputs.vtadmin_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.vtadmin_changes == 'true' run: | tools/check_make_vtadmin_authz_testgen.sh diff --git a/.github/workflows/check_make_vtadmin_web_proto.yml b/.github/workflows/check_make_vtadmin_web_proto.yml index d2703d54df1..9e2353aa6b2 100644 --- a/.github/workflows/check_make_vtadmin_web_proto.yml +++ b/.github/workflows/check_make_vtadmin_web_proto.yml @@ -6,10 +6,22 @@ jobs: name: Check Make VTAdmin Web Proto runs-on: ubuntu-latest steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -27,23 +39,23 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 - if: steps.changes.outputs.proto_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true' with: go-version: 1.18.4 - name: Setup Node - if: steps.changes.outputs.proto_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true' uses: actions/setup-node@v2 with: # node-version should match package.json node-version: '16.13.0' - name: Install npm dependencies - if: steps.changes.outputs.proto_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true' run: npm ci working-directory: ./web/vtadmin - name: check_make_vtadmin_web_proto - if: steps.changes.outputs.proto_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true' run: | tools/check_make_vtadmin_web_proto.sh diff --git a/.github/workflows/cluster_endtoend_12.yml b/.github/workflows/cluster_endtoend_12.yml index 6f74a2195de..18374117386 100644 --- a/.github/workflows/cluster_endtoend_12.yml +++ b/.github/workflows/cluster_endtoend_12.yml @@ -12,10 +12,22 @@ jobs: runs-on: self-hosted steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -35,30 +47,30 @@ jobs: - '.github/workflows/**' - name: Build Docker Image - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: docker build -f ./.github/docker/cluster_test_12/Dockerfile -t cluster_test_12:$GITHUB_SHA . - name: Run test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: docker run --name "cluster_test_12_$GITHUB_SHA" cluster_test_12:$GITHUB_SHA /bin/bash -c 'source build.env && go run test.go -keep-data=true -docker=false -print-log -follow -shard 12 -- -- --keep-data=true' - name: Print Volume Used - if: always() && steps.changes.outputs.end_to_end == 'true' + if: always() && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker inspect -f '{{ (index .Mounts 0).Name }}' cluster_test_12_$GITHUB_SHA - name: Cleanup Docker Volume - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker rm -v cluster_test_12_$GITHUB_SHA - name: Cleanup Docker Container - if: always() && steps.changes.outputs.end_to_end == 'true' + if: always() && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker rm -f cluster_test_12_$GITHUB_SHA - name: Cleanup Docker Image - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker image rm cluster_test_12:$GITHUB_SHA diff --git a/.github/workflows/cluster_endtoend_13.yml b/.github/workflows/cluster_endtoend_13.yml index d9134ce1f48..a902a1e0882 100644 --- a/.github/workflows/cluster_endtoend_13.yml +++ b/.github/workflows/cluster_endtoend_13.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard 13 | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_15.yml b/.github/workflows/cluster_endtoend_15.yml index 5a9a1c9cab2..54241ae285d 100644 --- a/.github/workflows/cluster_endtoend_15.yml +++ b/.github/workflows/cluster_endtoend_15.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard 15 | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_18.yml b/.github/workflows/cluster_endtoend_18.yml index 22e4b96fc5c..201bc45fbdd 100644 --- a/.github/workflows/cluster_endtoend_18.yml +++ b/.github/workflows/cluster_endtoend_18.yml @@ -12,10 +12,22 @@ jobs: runs-on: self-hosted steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -35,30 +47,30 @@ jobs: - '.github/workflows/**' - name: Build Docker Image - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: docker build -f ./.github/docker/cluster_test_18/Dockerfile -t cluster_test_18:$GITHUB_SHA . - name: Run test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: docker run --name "cluster_test_18_$GITHUB_SHA" cluster_test_18:$GITHUB_SHA /bin/bash -c 'source build.env && go run test.go -keep-data=true -docker=false -print-log -follow -shard 18 -- -- --keep-data=true' - name: Print Volume Used - if: always() && steps.changes.outputs.end_to_end == 'true' + if: always() && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker inspect -f '{{ (index .Mounts 0).Name }}' cluster_test_18_$GITHUB_SHA - name: Cleanup Docker Volume - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker rm -v cluster_test_18_$GITHUB_SHA - name: Cleanup Docker Container - if: always() && steps.changes.outputs.end_to_end == 'true' + if: always() && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker rm -f cluster_test_18_$GITHUB_SHA - name: Cleanup Docker Image - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker image rm cluster_test_18:$GITHUB_SHA diff --git a/.github/workflows/cluster_endtoend_21.yml b/.github/workflows/cluster_endtoend_21.yml index 30c2313e143..6402068e0f9 100644 --- a/.github/workflows/cluster_endtoend_21.yml +++ b/.github/workflows/cluster_endtoend_21.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard 21 | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_22.yml b/.github/workflows/cluster_endtoend_22.yml index e22ed0da6a1..1e5b4598d34 100644 --- a/.github/workflows/cluster_endtoend_22.yml +++ b/.github/workflows/cluster_endtoend_22.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard 22 | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_26.yml b/.github/workflows/cluster_endtoend_26.yml index bf68f6d39d0..8188e2009bd 100644 --- a/.github/workflows/cluster_endtoend_26.yml +++ b/.github/workflows/cluster_endtoend_26.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard 26 | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml index 39da33111e3..b38b5cdd7ff 100644 --- a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml +++ b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -116,7 +128,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard ers_prs_newfeatures_heavy | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_mysql80.yml b/.github/workflows/cluster_endtoend_mysql80.yml index 10d15df8bdf..c9ad171ead5 100644 --- a/.github/workflows/cluster_endtoend_mysql80.yml +++ b/.github/workflows/cluster_endtoend_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard mysql80 | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_mysql_server_vault.yml b/.github/workflows/cluster_endtoend_mysql_server_vault.yml index a4bc9bd5ab1..7693b4ec071 100644 --- a/.github/workflows/cluster_endtoend_mysql_server_vault.yml +++ b/.github/workflows/cluster_endtoend_mysql_server_vault.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,12 +83,12 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Installing zookeeper and consul - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make tools - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -88,7 +100,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -102,7 +114,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard mysql_server_vault | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_declarative.yml b/.github/workflows/cluster_endtoend_onlineddl_declarative.yml index c1cf74609cd..bfea5fc0c52 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_declarative.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_declarative.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_declarative | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml index f2a178aff0a..188373c7b66 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_declarative | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_ghost.yml b/.github/workflows/cluster_endtoend_onlineddl_ghost.yml index 451b461c366..c0265fd7fe0 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_ghost.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_ghost.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_ghost | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml index 986adfb69f0..d5e224dde1f 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_ghost | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert.yml b/.github/workflows/cluster_endtoend_onlineddl_revert.yml index 6f2bc6efed4..f673eeb3ddf 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revert.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revert.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_revert | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml index e43a6d71a0c..6410a3bbe84 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_revert | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_revertible.yml b/.github/workflows/cluster_endtoend_onlineddl_revertible.yml index c3acde31fde..8e33d226539 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revertible.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revertible.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_revertible | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml index e70bed861da..54b5c7a6d6f 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_revertible | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml index 3aa3b593050..ba738d4ca76 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_scheduler | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml index 3196826c7c6..a0ea5f5cbc0 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_scheduler | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_singleton.yml b/.github/workflows/cluster_endtoend_onlineddl_singleton.yml index d1e4f631a2c..3cc63806b7e 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_singleton.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_singleton.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_singleton | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml index 3dbfaaa98dc..b3718709fd3 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_singleton | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml index 99ac09b6ddb..0d61ff8eb90 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml index 1246db04c26..cd77a2b63cc 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml index 63c8a4f766b..0470a1bc3c6 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_stress | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml index 5918d5cc4ea..6dcac58a662 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_stress | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml index 8a56cfdddca..c82cb7513ab 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_stress_suite | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml index 9c175560eec..1e6048bc8cd 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_stress_suite | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml index 9496006fb3f..13ff64c1d71 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_suite | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml index b4a1dab6428..ab800db0d46 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_suite | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml index c962656c89d..eabfe9e0540 100644 --- a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml +++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard schemadiff_vrepl | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml index d0b3c6780bf..c6f06554753 100644 --- a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml +++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard schemadiff_vrepl | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml index d1438ada79b..311cc984559 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,12 +83,12 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Installing zookeeper and consul - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make tools - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -88,7 +100,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -102,7 +114,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_consul | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml index 8be01f65eb3..c927638617d 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_tablegc | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml index 884358b4edf..35d552d8e0d 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_tablegc | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml b/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml index 3ffa97c0ac1..37d2d03b278 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_throttler | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml b/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml index e1c2c8e4e8a..983cd87afe7 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_throttler_custom_config | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_topo_connection_cache.yml b/.github/workflows/cluster_endtoend_topo_connection_cache.yml index 261b4d9740b..d5cf30cbfc7 100644 --- a/.github/workflows/cluster_endtoend_topo_connection_cache.yml +++ b/.github/workflows/cluster_endtoend_topo_connection_cache.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard topo_connection_cache | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml index 03996bfcd33..bd02e5c8f49 100644 --- a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml +++ b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -126,7 +138,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vreplication_across_db_versions | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vreplication_basic.yml b/.github/workflows/cluster_endtoend_vreplication_basic.yml index 1433aad0be7..fe3a217fc46 100644 --- a/.github/workflows/cluster_endtoend_vreplication_basic.yml +++ b/.github/workflows/cluster_endtoend_vreplication_basic.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -116,7 +128,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vreplication_basic | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml index eedbaf331e8..e26835414f9 100644 --- a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml +++ b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -116,7 +128,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vreplication_cellalias | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml b/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml index 538364dbd41..7a13004886d 100644 --- a/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml +++ b/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -116,7 +128,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vreplication_migrate_vdiff2_convert_tz | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vreplication_multicell.yml b/.github/workflows/cluster_endtoend_vreplication_multicell.yml index 78d3333ba72..067a187ba75 100644 --- a/.github/workflows/cluster_endtoend_vreplication_multicell.yml +++ b/.github/workflows/cluster_endtoend_vreplication_multicell.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -116,7 +128,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vreplication_multicell | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vreplication_v2.yml b/.github/workflows/cluster_endtoend_vreplication_v2.yml index b001a3a485a..f5c8f65eb67 100644 --- a/.github/workflows/cluster_endtoend_vreplication_v2.yml +++ b/.github/workflows/cluster_endtoend_vreplication_v2.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -116,7 +128,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vreplication_v2 | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vstream_failover.yml b/.github/workflows/cluster_endtoend_vstream_failover.yml index ff14c919979..b03140be705 100644 --- a/.github/workflows/cluster_endtoend_vstream_failover.yml +++ b/.github/workflows/cluster_endtoend_vstream_failover.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vstream_failover | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml b/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml index 63b32522809..d131c019557 100644 --- a/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml +++ b/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vstream_stoponreshard_false | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml b/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml index c70f1330ff8..99829fdef32 100644 --- a/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml +++ b/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vstream_stoponreshard_true | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml b/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml index a1d9c7e23a9..4e7239dc68a 100644 --- a/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml +++ b/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vstream_with_keyspaces_to_watch | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtbackup_transform.yml b/.github/workflows/cluster_endtoend_vtbackup_transform.yml index 000df19a0b8..5eccc7969fd 100644 --- a/.github/workflows/cluster_endtoend_vtbackup_transform.yml +++ b/.github/workflows/cluster_endtoend_vtbackup_transform.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtbackup_transform | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml index 25f80c4d4d4..15e843dac2c 100644 --- a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -126,7 +138,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtctlbackup_sharded_clustertest_heavy | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml index 586e0c32818..722446f813a 100644 --- a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml +++ b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_concurrentdml | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_gen4.yml b/.github/workflows/cluster_endtoend_vtgate_gen4.yml index 86c2a5615e3..e5bf36f9f20 100644 --- a/.github/workflows/cluster_endtoend_vtgate_gen4.yml +++ b/.github/workflows/cluster_endtoend_vtgate_gen4.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_gen4 | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml index c16973eb230..8e3c490b9c3 100644 --- a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -116,7 +128,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_general_heavy | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_godriver.yml b/.github/workflows/cluster_endtoend_vtgate_godriver.yml index a28481b6d35..4e65186b8d2 100644 --- a/.github/workflows/cluster_endtoend_vtgate_godriver.yml +++ b/.github/workflows/cluster_endtoend_vtgate_godriver.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_godriver | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_queries.yml b/.github/workflows/cluster_endtoend_vtgate_queries.yml index 04ed29773a2..ad1e34545bf 100644 --- a/.github/workflows/cluster_endtoend_vtgate_queries.yml +++ b/.github/workflows/cluster_endtoend_vtgate_queries.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_queries | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml index cdde1ef2655..2f9f8bf7651 100644 --- a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml +++ b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_readafterwrite | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml index a4444277767..006433c4fa6 100644 --- a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml +++ b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_reservedconn | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_schema.yml b/.github/workflows/cluster_endtoend_vtgate_schema.yml index 43c27bf8158..0d9f3729a48 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_schema | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml index 72dc393e9ae..874b5f01b96 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_schema_tracker | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml index ff9f94d23b7..65e583fb1c2 100644 --- a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml +++ b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_tablet_healthcheck_cache | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_topo.yml b/.github/workflows/cluster_endtoend_vtgate_topo.yml index 837d12eae0b..2c0b137acfc 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_topo | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml index ac58e24e29a..26ae2c87e6c 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,12 +83,12 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Installing zookeeper and consul - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make tools - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -88,7 +100,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -102,7 +114,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_topo_consul | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml index 15b93e14ab9..742f72286e8 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_topo_etcd | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_transaction.yml b/.github/workflows/cluster_endtoend_vtgate_transaction.yml index 922a4274474..22f389d30df 100644 --- a/.github/workflows/cluster_endtoend_vtgate_transaction.yml +++ b/.github/workflows/cluster_endtoend_vtgate_transaction.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_transaction | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml index e48efe23733..3581b1b8ad9 100644 --- a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml +++ b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_unsharded | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml index 49a75a967bb..06463046e8c 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -116,7 +128,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_vindex_heavy | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtgate_vschema.yml b/.github/workflows/cluster_endtoend_vtgate_vschema.yml index fb7415f979f..091479719b4 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vschema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vschema.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtgate_vschema | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtorc.yml b/.github/workflows/cluster_endtoend_vtorc.yml index 0ffeebc25df..4a60f96ae31 100644 --- a/.github/workflows/cluster_endtoend_vtorc.yml +++ b/.github/workflows/cluster_endtoend_vtorc.yml @@ -17,10 +17,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -39,17 +51,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -57,7 +69,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -71,7 +83,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -83,7 +95,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -97,7 +109,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtorc | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_vtorc_8.0.yml b/.github/workflows/cluster_endtoend_vtorc_8.0.yml index f28e53e661b..2c1a3eeddf3 100644 --- a/.github/workflows/cluster_endtoend_vtorc_8.0.yml +++ b/.github/workflows/cluster_endtoend_vtorc_8.0.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -80,7 +92,7 @@ jobs: go install github.com/vitessio/go-junit-report@HEAD - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -92,7 +104,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -106,7 +118,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard vtorc_8.0 | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_xb_backup.yml b/.github/workflows/cluster_endtoend_xb_backup.yml index a28ee54bb3c..502d257a547 100644 --- a/.github/workflows/cluster_endtoend_xb_backup.yml +++ b/.github/workflows/cluster_endtoend_xb_backup.yml @@ -21,10 +21,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -43,17 +55,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -61,7 +73,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -87,7 +99,7 @@ jobs: fi - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -99,7 +111,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -113,7 +125,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard xb_backup | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml index 8cb546f9cac..2668463a8ae 100644 --- a/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml +++ b/.github/workflows/cluster_endtoend_xb_backup_mysql80.yml @@ -18,10 +18,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -40,17 +52,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -58,7 +70,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -77,12 +89,12 @@ jobs: go mod download # install JUnit report formatter - go install github.com/jstemmer/go-junit-report@latest + go install github.com/vitessio/go-junit-report@HEAD sudo apt-get install percona-xtrabackup-80 lz4 - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -94,7 +106,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -108,7 +120,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard xb_backup | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/cluster_endtoend_xb_recovery.yml b/.github/workflows/cluster_endtoend_xb_recovery.yml index 23c01723ef7..179c77340f2 100644 --- a/.github/workflows/cluster_endtoend_xb_recovery.yml +++ b/.github/workflows/cluster_endtoend_xb_recovery.yml @@ -21,10 +21,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -43,17 +55,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -61,7 +73,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -87,7 +99,7 @@ jobs: fi - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -99,7 +111,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -113,7 +125,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard xb_recovery | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/.github/workflows/docker_test_cluster_10.yml b/.github/workflows/docker_test_cluster_10.yml index df6379dfa5f..9d29b45aff0 100644 --- a/.github/workflows/docker_test_cluster_10.yml +++ b/.github/workflows/docker_test_cluster_10.yml @@ -7,10 +7,22 @@ jobs: runs-on: ubuntu-latest steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip $skip + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -29,24 +41,25 @@ jobs: - 'docker/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | + echo "value: " ${{steps.skip-workflow.outputs.skip-workflow}} echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185 - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED! - name: Run tests which require docker - 1 - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go run test.go -docker=true --follow -shard 10 diff --git a/.github/workflows/docker_test_cluster_25.yml b/.github/workflows/docker_test_cluster_25.yml index 75f61cd81db..b4a59c84934 100644 --- a/.github/workflows/docker_test_cluster_25.yml +++ b/.github/workflows/docker_test_cluster_25.yml @@ -7,10 +7,22 @@ jobs: runs-on: ubuntu-latest steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -29,24 +41,24 @@ jobs: - 'docker/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185 - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED! - name: Run tests which require docker - 2 - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go run test.go -docker=true --follow -shard 25 diff --git a/.github/workflows/e2e_race.yml b/.github/workflows/e2e_race.yml index 0a55f376706..d31a679d0e1 100644 --- a/.github/workflows/e2e_race.yml +++ b/.github/workflows/e2e_race.yml @@ -6,10 +6,22 @@ jobs: name: End-to-End Test (Race) runs-on: ubuntu-latest steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -27,18 +39,18 @@ jobs: - 'bootstrap.sh' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup MySQL 8.0 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 @@ -56,12 +68,12 @@ jobs: go mod download - name: Run make minimaltools - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make minimaltools - name: e2e_race - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | make e2e_test_race diff --git a/.github/workflows/endtoend.yml b/.github/workflows/endtoend.yml index 591dbd55245..1bebe17936b 100644 --- a/.github/workflows/endtoend.yml +++ b/.github/workflows/endtoend.yml @@ -6,10 +6,22 @@ jobs: name: End-to-End Test runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -27,25 +39,25 @@ jobs: - 'bootstrap.sh' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185 - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED! - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget @@ -56,17 +68,17 @@ jobs: go mod download - name: Run make minimaltools - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make minimaltools - name: Build - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make build - name: endtoend - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | eatmydata -- tools/e2e_test_runner.sh diff --git a/.github/workflows/local_example.yml b/.github/workflows/local_example.yml index e22f21e501a..d6a95faa876 100644 --- a/.github/workflows/local_example.yml +++ b/.github/workflows/local_example.yml @@ -11,10 +11,22 @@ jobs: topo: [consul,etcd,k8s] steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -33,18 +45,18 @@ jobs: - 'examples/**' - name: Set up Go - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get dependencies - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' run: | if [ ${{matrix.os}} = "ubuntu-latest" ]; then # Setup MySQL 8.0 @@ -66,17 +78,17 @@ jobs: go mod download - name: Run make minimaltools - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' run: | make minimaltools - name: Build - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' run: | make build - name: local_example - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' timeout-minutes: 30 run: | export TOPO=${{matrix.topo}} diff --git a/.github/workflows/region_example.yml b/.github/workflows/region_example.yml index f3b74fe3889..81628d926cb 100644 --- a/.github/workflows/region_example.yml +++ b/.github/workflows/region_example.yml @@ -11,10 +11,22 @@ jobs: topo: [etcd] steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -33,18 +45,18 @@ jobs: - 'examples/**' - name: Set up Go - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get dependencies - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' run: | if [ ${{matrix.os}} = "ubuntu-latest" ]; then # Setup MySQL 8.0 @@ -66,17 +78,17 @@ jobs: go mod download - name: Run make minimaltools - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' run: | make minimaltools - name: Build - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' run: | make build - name: region_example - if: steps.changes.outputs.examples == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true' timeout-minutes: 30 run: | export TOPO=${{matrix.topo}} diff --git a/.github/workflows/static_checks_etc.yml b/.github/workflows/static_checks_etc.yml index 3907a746d09..4f9d9856fbd 100644 --- a/.github/workflows/static_checks_etc.yml +++ b/.github/workflows/static_checks_etc.yml @@ -10,15 +10,28 @@ jobs: runs-on: ubuntu-latest steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Checkout code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Run FOSSA scan and upload build data + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: fossa-contrib/fossa-action@v1 with: fossa-api-key: 76d7483ea206d530d9452e44bffe7ba8 - name: Check for changes in Go files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -67,41 +80,41 @@ jobs: - name: Set up Go - if: steps.changes.outputs.go_files == 'true' || steps.changes.outputs.parser_changes == 'true' || steps.changes.outputs.proto_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' || steps.changes.outputs.parser_changes == 'true' || steps.changes.outputs.proto_changes == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.go_files == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185 - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file - if: steps.changes.outputs.go_files == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' run: | echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED! - name: Run go fmt - if: steps.changes.outputs.go_files == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' run: | gofmt -l . | grep -vF vendor/ && exit 1 || echo "All files formatted correctly" - name: Install goimports - if: steps.changes.outputs.go_files == 'true' || steps.changes.outputs.visitor == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' || steps.changes.outputs.visitor == 'true' run: | go install golang.org/x/tools/cmd/goimports@latest - name: Run goimports - if: steps.changes.outputs.go_files == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' run: | out=$(goimports -local vitess.io/vitess -l -w $(find . -name "*.go" | grep -v ".pb.go")) echo $out | grep go > /dev/null && echo -e "The following files are malformatted:\n$out" && exit 1 || echo "All the files are formatted correctly" - name: Get dependencies - if: steps.changes.outputs.parser_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.parser_changes == 'true' run: | sudo apt-get update sudo apt-get install -y make unzip g++ etcd curl git wget @@ -109,50 +122,50 @@ jobs: go mod download - name: Run make minimaltools - if: steps.changes.outputs.parser_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.parser_changes == 'true' run: | make minimaltools - name: check_make_parser - if: steps.changes.outputs.parser_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.parser_changes == 'true' run: | tools/check_make_parser.sh - name: check_make_sizegen - if: steps.changes.outputs.sizegen == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.sizegen == 'true' run: | tools/check_make_sizegen.sh - name: check_make_visitor - if: steps.changes.outputs.visitor == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.visitor == 'true' run: | misc/git/hooks/asthelpers - name: run ensure_bootstrap_version - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make ensure_bootstrap_version git status test -z "$(git diff-index --name-only HEAD --)" || exit 1 - name: Install golangci-lint - if: steps.changes.outputs.go_files == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2 - name: Clean Env - if: steps.changes.outputs.go_files == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' run: $(go env GOPATH)/bin/golangci-lint cache clean - name: Print linter version - if: steps.changes.outputs.go_files == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' run: $(go env GOPATH)/bin/golangci-lint --version - name: Run golangci-lint - if: steps.changes.outputs.go_files == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' run: $(go env GOPATH)/bin/golangci-lint run go/... - name: Run go mod tidy - if: steps.changes.outputs.go_files == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true' run: | set -e go mod tidy @@ -166,6 +179,6 @@ jobs: exit 1 - name: check_make_proto - if: steps.changes.outputs.proto_changes == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true' run: | tools/check_make_proto.sh diff --git a/.github/workflows/unit_race.yml b/.github/workflows/unit_race.yml index 91115d40eb0..37f7f29fbfa 100644 --- a/.github/workflows/unit_race.yml +++ b/.github/workflows/unit_race.yml @@ -10,10 +10,22 @@ jobs: name: Unit Test (Race) runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -31,18 +43,18 @@ jobs: - 'bootstrap.sh' - name: Set up Go - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get dependencies - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | export DEBIAN_FRONTEND="noninteractive" sudo apt-get update @@ -64,12 +76,12 @@ jobs: go install golang.org/x/tools/cmd/goimports@latest - name: Run make tools - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | make tools - name: unit_race - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' timeout-minutes: 30 run: | eatmydata -- make unit_test_race diff --git a/.github/workflows/unit_test_mariadb103.yml b/.github/workflows/unit_test_mariadb103.yml index b78c11230ca..e5e18f3d2ea 100644 --- a/.github/workflows/unit_test_mariadb103.yml +++ b/.github/workflows/unit_test_mariadb103.yml @@ -11,10 +11,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -33,13 +45,13 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -47,7 +59,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | export DEBIAN_FRONTEND="noninteractive" sudo apt-get update @@ -84,12 +96,12 @@ jobs: go install golang.org/x/tools/cmd/goimports@latest - name: Run make tools - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | make tools - name: Run test - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' timeout-minutes: 30 run: | eatmydata -- make unit_test diff --git a/.github/workflows/unit_test_mysql57.yml b/.github/workflows/unit_test_mysql57.yml index 9e7fcc0eb6b..ad29d22b272 100644 --- a/.github/workflows/unit_test_mysql57.yml +++ b/.github/workflows/unit_test_mysql57.yml @@ -11,10 +11,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -33,13 +45,13 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -47,7 +59,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | export DEBIAN_FRONTEND="noninteractive" sudo apt-get update @@ -69,12 +81,12 @@ jobs: go install golang.org/x/tools/cmd/goimports@latest - name: Run make tools - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | make tools - name: Run test - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' timeout-minutes: 30 run: | eatmydata -- make unit_test diff --git a/.github/workflows/unit_test_mysql80.yml b/.github/workflows/unit_test_mysql80.yml index 2902ad03d3a..8ded75622e2 100644 --- a/.github/workflows/unit_test_mysql80.yml +++ b/.github/workflows/unit_test_mysql80.yml @@ -11,10 +11,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -33,13 +45,13 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -47,7 +59,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | export DEBIAN_FRONTEND="noninteractive" sudo apt-get update @@ -87,12 +99,12 @@ jobs: go install golang.org/x/tools/cmd/goimports@latest - name: Run make tools - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | make tools - name: Run test - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' timeout-minutes: 30 run: | eatmydata -- make unit_test diff --git a/.github/workflows/upgrade_downgrade_test_backups_e2e.yml b/.github/workflows/upgrade_downgrade_test_backups_e2e.yml index fb18f663de3..1242c6f330e 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_e2e.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_e2e.yml @@ -29,18 +29,30 @@ jobs: echo "::set-output name=previous_release_ref::${previous_release_ref}" upgrade_downgrade_test_e2e: + timeout-minutes: 60 if: always() && needs.get_previous_release.result == 'success' name: Run Upgrade Downgrade Test runs-on: ubuntu-18.04 - timeout-minutes: 60 needs: - get_previous_release steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out commit's code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -59,22 +71,22 @@ jobs: - 'bootstrap.sh' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get base dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -85,7 +97,7 @@ jobs: go mod download # install JUnit report formatter - go install github.com/vitessio/go-junit-report@HEAD + go install github.com/jstemmer/go-junit-report@latest wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo apt-get install -y gnupg2 @@ -95,18 +107,18 @@ jobs: # Checkout to the last release of Vitess - name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }}) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 with: ref: ${{ needs.get_previous_release.outputs.previous_release }} - name: Get dependencies for the last release - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building last release's binaries - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -117,16 +129,16 @@ jobs: # Checkout to this build's commit - name: Check out commit's code - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 - name: Get dependencies for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building the binaries for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -136,7 +148,7 @@ jobs: # Swap binaries, use last release's VTTablet - name: Use last release's VTTablet - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -146,7 +158,7 @@ jobs: # Run test with VTTablet at version N-1 and VTBackup at version N - name: Run backups tests (vttablet=N-1, vtbackup=N) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot @@ -156,7 +168,7 @@ jobs: # Swap binaries again, use current version's VTTablet, and last release's VTBackup - name: Use current version VTTablet, and other version VTBackup - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -168,7 +180,7 @@ jobs: # Run test again with VTTablet at version N, and VTBackup at version N-1 - name: Run backups tests (vttablet=N, vtbackup=N-1) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual.yml b/.github/workflows/upgrade_downgrade_test_backups_manual.yml index 3e628e4dde0..fd92fbf8de3 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_manual.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_manual.yml @@ -38,11 +38,23 @@ jobs: - get_previous_release steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + # Checkout to this build's commit - name: Checkout to commit's code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -61,29 +73,29 @@ jobs: - 'bootstrap.sh' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185 - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED! - name: Get base dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo DEBIAN_FRONTEND="noninteractive" apt-get update # Uninstall any previously installed MySQL first @@ -110,7 +122,7 @@ jobs: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" # install JUnit report formatter - go install github.com/vitessio/go-junit-report@HEAD + go install github.com/jstemmer/go-junit-report@latest wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo apt-get install -y gnupg2 @@ -120,18 +132,18 @@ jobs: # Checkout to the last release of Vitess - name: Checkout to the other version's code (${{ needs.get_previous_release.outputs.previous_release }}) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 with: ref: ${{ needs.get_previous_release.outputs.previous_release }} - name: Get dependencies for the last release - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building last release's binaries - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 5 run: | source build.env @@ -142,21 +154,21 @@ jobs: # Checkout to this build's commit - name: Checkout to commit's code - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 - name: Get dependencies for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Run make minimaltools - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make minimaltools - name: Building the binaries for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 5 run: | source build.env @@ -167,7 +179,7 @@ jobs: # We create a sharded Vitess cluster following the local example. # We also insert a few rows in our three tables. - name: Create the example Vitess cluster with all components using version N - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 5 run: | source build.env ; cd examples/local @@ -175,7 +187,7 @@ jobs: # Taking a backup - name: Take a backup of all the shards - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 2 run: | source build.env ; cd examples/local @@ -189,7 +201,7 @@ jobs: # - corder: 5 # We shall see the same number of rows after restoring the backup. - name: Insert more data after the backup - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env ; cd examples/local ; source ./env.sh @@ -199,7 +211,7 @@ jobs: # Stop all the tablets and remove their data - name: Stop tablets - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 5 run: | source build.env ; cd examples/local @@ -207,7 +219,7 @@ jobs: # We downgrade: we use the version N-1 of vttablet - name: Downgrade - Swap binaries, use VTTablet N-1 - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -217,7 +229,7 @@ jobs: # Starting the tablets again, they will automatically start restoring the last backup. - name: Start new tablets and restore - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 5 run: | source build.env ; cd examples/local @@ -227,7 +239,7 @@ jobs: # Count the number of rows in each table to make sure the restoration is successful. - name: Assert the number of rows in every table - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env ; cd examples/local ; source ./env.sh @@ -237,7 +249,7 @@ jobs: # We insert one more row in every table. - name: Insert more rows in the tables - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env ; cd examples/local ; source ./env.sh @@ -247,7 +259,7 @@ jobs: # Taking a second backup of the cluster. - name: Take a second backup of all the shards - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 2 run: | source build.env ; cd examples/local @@ -255,7 +267,7 @@ jobs: # Stopping the tablets so we can perform the upgrade. - name: Stop tablets - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 5 run: | source build.env ; cd examples/local @@ -263,7 +275,7 @@ jobs: # We upgrade: we swap binaries and use the version N of the tablet. - name: Upgrade - Swap binaries, use VTTablet N - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -273,7 +285,7 @@ jobs: # Starting the tablets again and restoring the previous backup. - name: Start new tablets and restore - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 5 run: | source build.env ; cd examples/local @@ -283,7 +295,7 @@ jobs: # We count the number of rows in every table to check that the restore step was successful. - name: Assert the number of rows in every table - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env ; cd examples/local ; source ./env.sh @@ -292,7 +304,7 @@ jobs: echo "select count(sku) from corder;" | mysql 2>&1| grep 6 - name: Stop the Vitess cluster - if: always() && steps.changes.outputs.end_to_end == 'true' + if: always() && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env ; cd examples/local ./401_teardown.sh || true diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml index b1b16e9e2a4..4da01aea522 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml @@ -35,16 +35,27 @@ jobs: if: always() && (needs.get_previous_release.result == 'success') name: Run Upgrade Downgrade Test runs-on: ubuntu-latest - timeout-minutes: 60 needs: - get_upgrade_downgrade_label - get_previous_release steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out commit's code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -63,22 +74,22 @@ jobs: - 'bootstrap.sh' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get base dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo DEBIAN_FRONTEND="noninteractive" apt-get update # Uninstall any previously installed MySQL first @@ -105,7 +116,7 @@ jobs: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" # install JUnit report formatter - go install github.com/vitessio/go-junit-report@HEAD + go install github.com/jstemmer/go-junit-report@latest wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo apt-get install -y gnupg2 @@ -115,18 +126,18 @@ jobs: # Checkout to the last release of Vitess - name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }}) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 with: ref: ${{ needs.get_previous_release.outputs.previous_release }} - name: Get dependencies for the last release - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building last release's binaries - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -137,16 +148,16 @@ jobs: # Checkout to this build's commit - name: Check out commit's code - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 - name: Get dependencies for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building the binaries for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -156,7 +167,7 @@ jobs: # Running a test with vtgate and vttablet using version n - name: Run query serving tests (vtgate=N, vttablet=N) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot @@ -166,7 +177,7 @@ jobs: # Swap the binaries in the bin. Use vtgate version n-1 and keep vttablet at version n - name: Use last release's VTGate - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -176,7 +187,7 @@ jobs: # Running a test with vtgate at version n-1 and vttablet at version n - name: Run query serving tests (vtgate=N-1, vttablet=N) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot @@ -186,7 +197,7 @@ jobs: # Swap the binaries again. This time, vtgate will be at version n, and vttablet will be at version n-1 - name: Use current version VTGate, and other version VTTablet - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -198,7 +209,7 @@ jobs: # Running a test with vtgate at version n and vttablet at version n-1 - name: Run query serving tests (vtgate=N, vttablet=N-1) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml index e79b104db77..58c857d9596 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml @@ -35,15 +35,26 @@ jobs: if: always() && (needs.get_previous_release.result == 'success') name: Run Upgrade Downgrade Test runs-on: ubuntu-latest - timeout-minutes: 60 needs: - get_previous_release steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out commit's code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -62,22 +73,22 @@ jobs: - 'bootstrap.sh' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get base dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo DEBIAN_FRONTEND="noninteractive" apt-get update # Uninstall any previously installed MySQL first @@ -104,7 +115,7 @@ jobs: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" # install JUnit report formatter - go install github.com/vitessio/go-junit-report@HEAD + go install github.com/jstemmer/go-junit-report@latest wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo apt-get install -y gnupg2 @@ -114,18 +125,18 @@ jobs: # Checkout to the last release of Vitess - name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }}) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 with: ref: ${{ needs.get_previous_release.outputs.previous_release }} - name: Get dependencies for the last release - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building last release's binaries - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -136,16 +147,16 @@ jobs: # Checkout to this build's commit - name: Check out commit's code - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 - name: Get dependencies for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building the binaries for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -155,7 +166,7 @@ jobs: # Running a test with vtgate and vttablet using version n - name: Run query serving tests (vtgate=N, vttablet=N) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot @@ -165,7 +176,7 @@ jobs: # Swap the binaries in the bin. Use vtgate version n-1 and keep vttablet at version n - name: Use last release's VTGate - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -175,7 +186,7 @@ jobs: # Running a test with vtgate at version n-1 and vttablet at version n - name: Run query serving tests (vtgate=N-1, vttablet=N) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot @@ -185,7 +196,7 @@ jobs: # Swap the binaries again. This time, vtgate will be at version n, and vttablet will be at version n-1 - name: Use current version VTGate, and other version VTTablet - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -197,7 +208,7 @@ jobs: # Running a test with vtgate at version n and vttablet at version n-1 - name: Run query serving tests (vtgate=N, vttablet=N-1) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml index ede714a953c..10fb10a14c4 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml @@ -35,15 +35,26 @@ jobs: if: always() && (needs.get_previous_release.result == 'success') name: Run Upgrade Downgrade Test runs-on: ubuntu-latest - timeout-minutes: 60 needs: - get_previous_release steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out commit's code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -62,22 +73,22 @@ jobs: - 'bootstrap.sh' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get base dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo DEBIAN_FRONTEND="noninteractive" apt-get update # Uninstall any previously installed MySQL first @@ -104,7 +115,7 @@ jobs: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" # install JUnit report formatter - go install github.com/vitessio/go-junit-report@HEAD + go install github.com/jstemmer/go-junit-report@latest wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo apt-get install -y gnupg2 @@ -114,18 +125,18 @@ jobs: # Checkout to the last release of Vitess - name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }}) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 with: ref: ${{ needs.get_previous_release.outputs.previous_release }} - name: Get dependencies for the last release - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building last release's binaries - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -136,16 +147,16 @@ jobs: # Checkout to this build's commit - name: Check out commit's code - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 - name: Get dependencies for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building the binaries for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -155,7 +166,7 @@ jobs: # Swap the binaries in the bin. Use vtctl version n-1 and keep vttablet at version n - name: Use last release's Vtctl - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -169,7 +180,7 @@ jobs: # Running a test with vtctl at version n-1 and vttablet at version n - name: Run reparent tests (vtctl=N-1, vttablet=N) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml index 044ddc64773..082bbb92bcc 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml @@ -37,15 +37,26 @@ jobs: if: always() && (needs.get_previous_release.result == 'success') name: Run Upgrade Downgrade Test runs-on: ubuntu-latest - timeout-minutes: 60 needs: - get_previous_release steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out commit's code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -64,22 +75,22 @@ jobs: - 'bootstrap.sh' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Get base dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo DEBIAN_FRONTEND="noninteractive" apt-get update # Uninstall any previously installed MySQL first @@ -106,7 +117,7 @@ jobs: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" # install JUnit report formatter - go install github.com/vitessio/go-junit-report@HEAD + go install github.com/jstemmer/go-junit-report@latest wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo apt-get install -y gnupg2 @@ -116,18 +127,18 @@ jobs: # Checkout to the last release of Vitess - name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }}) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 with: ref: ${{ needs.get_previous_release.outputs.previous_release }} - name: Get dependencies for the last release - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building last release's binaries - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -138,16 +149,16 @@ jobs: # Checkout to this build's commit - name: Check out commit's code - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/checkout@v2 - name: Get dependencies for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | go mod download - name: Building the binaries for this commit - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 10 run: | source build.env @@ -157,7 +168,7 @@ jobs: # Swap the binaries. Use vtctl version n and keep vttablet at version n-1 - name: Use current version Vtctl, and other version VTTablet - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | source build.env @@ -168,7 +179,7 @@ jobs: # Running a test with vtctl at version n and vttablet at version n-1 - name: Run reparent tests (vtctl=N, vttablet=N-1) - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | rm -rf /tmp/vtdataroot mkdir -p /tmp/vtdataroot diff --git a/.github/workflows/vtadmin_web_build.yml b/.github/workflows/vtadmin_web_build.yml index 78c7e37c42e..97a5ec9eca6 100644 --- a/.github/workflows/vtadmin_web_build.yml +++ b/.github/workflows/vtadmin_web_build.yml @@ -12,26 +12,36 @@ on: - '.github/workflows/vtadmin_web_build.yml' - 'web/vtadmin/**' -defaults: - run: - working-directory: ./web/vtadmin - jobs: build: runs-on: ubuntu-latest steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - uses: actions/checkout@v2 + if: steps.skip-workflow.outputs.skip-workflow == 'false' - uses: actions/setup-node@v2 + if: steps.skip-workflow.outputs.skip-workflow == 'false' with: # node-version should match package.json node-version: '16.13.0' - name: Install dependencies - run: npm ci + if: steps.skip-workflow.outputs.skip-workflow == 'false' + run: cd ./web/vtadmin && npm ci - name: Build front-end - run: npm run build + if: steps.skip-workflow.outputs.skip-workflow == 'false' + run: cd ./web/vtadmin && npm run build # Cancel pending and in-progress runs of this workflow if a newer ref is pushed to CI. concurrency: diff --git a/.github/workflows/vtadmin_web_lint.yml b/.github/workflows/vtadmin_web_lint.yml index a77a5ff6d2a..02071d72e53 100644 --- a/.github/workflows/vtadmin_web_lint.yml +++ b/.github/workflows/vtadmin_web_lint.yml @@ -12,23 +12,32 @@ on: - '.github/workflows/vtadmin_web_lint.yml' - 'web/vtadmin/**' -defaults: - run: - working-directory: ./web/vtadmin - jobs: lint: runs-on: ubuntu-latest steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - uses: actions/checkout@v2 + if: steps.skip-workflow.outputs.skip-workflow == 'false' - uses: actions/setup-node@v2 + if: steps.skip-workflow.outputs.skip-workflow == 'false' with: # node-version should match package.json node-version: '16.13.0' - name: Install dependencies - run: npm ci + if: steps.skip-workflow.outputs.skip-workflow == 'false' + run: cd ./web/vtadmin && npm ci # Using "if: always()" means each step will run, even if a previous # step fails. This is nice because, for example, we want stylelint and @@ -39,16 +48,16 @@ jobs: # A nice enhancement is to parallelize these steps into jobs, with the # trade-off of more complexity around sharing npm install artifacts. - name: Run eslint - if: always() - run: npm run lint:eslint + if: steps.skip-workflow.outputs.skip-workflow == 'false' && always() + run: cd ./web/vtadmin && npm run lint:eslint - name: Run stylelint - if: always() - run: npm run lint:stylelint -- -f verbose + if: steps.skip-workflow.outputs.skip-workflow == 'false' && always() + run: cd ./web/vtadmin && npm run lint:stylelint -- -f verbose - name: Run prettier - if: always() - run: npm run lint:prettier + if: steps.skip-workflow.outputs.skip-workflow == 'false' && always() + run: cd ./web/vtadmin && npm run lint:prettier # Cancel pending and in-progress runs of this workflow if a newer ref is pushed to CI. concurrency: diff --git a/.github/workflows/vtadmin_web_unit_tests.yml b/.github/workflows/vtadmin_web_unit_tests.yml index e469d367ae1..21172a25759 100644 --- a/.github/workflows/vtadmin_web_unit_tests.yml +++ b/.github/workflows/vtadmin_web_unit_tests.yml @@ -12,26 +12,36 @@ on: - '.github/workflows/vtadmin_web_unit_tests.yml' - 'web/vtadmin/**' -defaults: - run: - working-directory: ./web/vtadmin - jobs: unit-tests: runs-on: ubuntu-latest steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - uses: actions/checkout@v2 + if: steps.skip-workflow.outputs.skip-workflow == 'false' - uses: actions/setup-node@v2 + if: steps.skip-workflow.outputs.skip-workflow == 'false' with: # node-version should match package.json node-version: '16.13.0' - name: Install dependencies - run: npm ci + if: steps.skip-workflow.outputs.skip-workflow == 'false' + run: cd ./web/vtadmin && npm ci - name: Run unit tests - run: CI=true npm run test + if: steps.skip-workflow.outputs.skip-workflow == 'false' + run: cd ./web/vtadmin && CI=true npm run test # Cancel pending and in-progress runs of this workflow if a newer ref is pushed to CI. concurrency: diff --git a/test/templates/cluster_endtoend_test.tpl b/test/templates/cluster_endtoend_test.tpl index a29de4eba3c..b2e10790c47 100644 --- a/test/templates/cluster_endtoend_test.tpl +++ b/test/templates/cluster_endtoend_test.tpl @@ -20,10 +20,22 @@ jobs: {{if .Ubuntu20}}runs-on: ubuntu-20.04{{else}}runs-on: ubuntu-18.04{{end}} steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "{{"${{github.event.pull_request}}"}}" == "" ]] && [[ "{{"${{github.ref}}"}}" != "refs/heads/main" ]] && [[ ! "{{"${{github.ref}}"}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "{{"${{github.ref}}"}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -42,17 +54,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -60,7 +72,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | sudo apt-get update sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata @@ -92,14 +104,14 @@ jobs: {{if .MakeTools}} - name: Installing zookeeper and consul - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make tools {{end}} - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -111,7 +123,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -146,7 +158,7 @@ jobs: eatmydata -- go run test.go -docker=false -follow -shard {{.Shard}} | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/test/templates/cluster_endtoend_test_docker.tpl b/test/templates/cluster_endtoend_test_docker.tpl index 60d57287642..d09216c28aa 100644 --- a/test/templates/cluster_endtoend_test_docker.tpl +++ b/test/templates/cluster_endtoend_test_docker.tpl @@ -7,10 +7,22 @@ jobs: {{if .Ubuntu20}}runs-on: ubuntu-20.04{{else}}runs-on: ubuntu-latest{{end}} steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "{{"${{github.event.pull_request}}"}}" == "" ]] && [[ "{{"${{github.ref}}"}}" != "refs/heads/main" ]] && [[ ! "{{"${{github.ref}}"}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "{{"${{github.ref}}"}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -29,18 +41,18 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | go run test.go -docker=true --follow -shard {{.Shard}} diff --git a/test/templates/cluster_endtoend_test_mysql80.tpl b/test/templates/cluster_endtoend_test_mysql80.tpl index 2a27cc092f5..7c8bb54faf9 100644 --- a/test/templates/cluster_endtoend_test_mysql80.tpl +++ b/test/templates/cluster_endtoend_test_mysql80.tpl @@ -16,10 +16,22 @@ jobs: timeout-minutes: 45 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "{{"${{github.event.pull_request}}"}}" == "" ]] && [[ "{{"${{github.ref}}"}}" != "refs/heads/main" ]] && [[ ! "{{"${{github.ref}}"}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "{{"${{github.ref}}"}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -38,17 +50,17 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Set up python - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' uses: actions/setup-python@v2 - name: Tune the OS - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -56,7 +68,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup Percona Server for MySQL 8.0 sudo apt-get update @@ -86,14 +98,14 @@ jobs: {{if .MakeTools}} - name: Installing zookeeper and consul - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | make tools {{end}} - name: Setup launchable dependencies - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up pip3 install --user launchable~=1.0 > /dev/null @@ -105,7 +117,7 @@ jobs: launchable record build --name "$GITHUB_RUN_ID" --source . - name: Run cluster endtoend test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: | # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file @@ -141,7 +153,7 @@ jobs: eatmydata -- go run test.go -docker={{if .Docker}}true -flavor={{.Platform}}{{else}}false{{end}} -follow -shard {{.Shard}} | tee -a output.txt | go-junit-report -set-exit-code > report.xml - name: Print test output and Record test result in launchable - if: steps.changes.outputs.end_to_end == 'true' && always() + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() run: | # send recorded tests to launchable launchable record tests --build "$GITHUB_RUN_ID" go-test . || true diff --git a/test/templates/cluster_endtoend_test_self_hosted.tpl b/test/templates/cluster_endtoend_test_self_hosted.tpl index 0ba0a31e380..a10c358472b 100644 --- a/test/templates/cluster_endtoend_test_self_hosted.tpl +++ b/test/templates/cluster_endtoend_test_self_hosted.tpl @@ -10,10 +10,22 @@ jobs: runs-on: self-hosted steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "{{"${{github.event.pull_request}}"}}" == "" ]] && [[ "{{"${{github.ref}}"}}" != "refs/heads/main" ]] && [[ ! "{{"${{github.ref}}"}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "{{"${{github.ref}}"}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -33,30 +45,30 @@ jobs: - '.github/workflows/**' - name: Build Docker Image - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: docker build -f {{.Dockerfile}} -t {{.ImageName}}:$GITHUB_SHA . - name: Run test - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' timeout-minutes: 30 run: docker run --name "{{.ImageName}}_$GITHUB_SHA" {{.ImageName}}:$GITHUB_SHA /bin/bash -c 'source build.env && go run test.go -keep-data=true -docker=false -print-log -follow -shard {{.Shard}} -- -- --keep-data=true' - name: Print Volume Used - if: always() && steps.changes.outputs.end_to_end == 'true' + if: always() && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker inspect -f '{{"{{ (index .Mounts 0).Name }}"}}' {{.ImageName}}_$GITHUB_SHA - name: Cleanup Docker Volume - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker rm -v {{.ImageName}}_$GITHUB_SHA - name: Cleanup Docker Container - if: always() && steps.changes.outputs.end_to_end == 'true' + if: always() && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker rm -f {{.ImageName}}_$GITHUB_SHA - name: Cleanup Docker Image - if: steps.changes.outputs.end_to_end == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | docker image rm {{.ImageName}}:$GITHUB_SHA diff --git a/test/templates/unit_test.tpl b/test/templates/unit_test.tpl index 3ecbd142cc7..b583bd8d3ba 100644 --- a/test/templates/unit_test.tpl +++ b/test/templates/unit_test.tpl @@ -9,10 +9,22 @@ jobs: runs-on: ubuntu-18.04 steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "{{"${{github.event.pull_request}}"}}" == "" ]] && [[ "{{"${{github.ref}}"}}" != "refs/heads/main" ]] && [[ ! "{{"${{github.ref}}"}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "{{"${{github.ref}}"}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -31,13 +43,13 @@ jobs: - '.github/workflows/**' - name: Set up Go - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' uses: actions/setup-go@v2 with: go-version: 1.18.4 - name: Tune the OS - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio @@ -45,7 +57,7 @@ jobs: sudo sysctl -p /etc/sysctl.conf - name: Get dependencies - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | export DEBIAN_FRONTEND="noninteractive" sudo apt-get update @@ -130,12 +142,12 @@ jobs: go install golang.org/x/tools/cmd/goimports@latest - name: Run make tools - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | make tools - name: Run test - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' timeout-minutes: 30 run: | eatmydata -- make unit_test diff --git a/test/templates/unit_test_self_hosted.tpl b/test/templates/unit_test_self_hosted.tpl index 7944ef5f6d5..c97ef9033f1 100644 --- a/test/templates/unit_test_self_hosted.tpl +++ b/test/templates/unit_test_self_hosted.tpl @@ -9,10 +9,22 @@ jobs: runs-on: self-hosted steps: + - name: Check if workflow needs to be skipped + id: skip-workflow + run: | + skip='false' + if [[ "{{"${{github.event.pull_request}}"}}" == "" ]] && [[ "{{"${{github.ref}}"}}" != "refs/heads/main" ]] && [[ ! "{{"${{github.ref}}"}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "{{"${{github.ref}}"}}" =~ "refs/tags/.*" ]]; then + skip='true' + fi + echo Skip ${skip} + echo "::set-output name=skip-workflow::${skip}" + - name: Check out code + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: actions/checkout@v2 - name: Check for changes in relevant files + if: steps.skip-workflow.outputs.skip-workflow == 'false' uses: frouioui/paths-filter@main id: changes with: @@ -31,32 +43,32 @@ jobs: - '.github/workflows/**' - name: Build Docker Image - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: docker build -f {{.Dockerfile}} -t {{.ImageName}}:$GITHUB_SHA . - name: Run test - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' timeout-minutes: 30 run: docker run --name "{{.ImageName}}_$GITHUB_SHA" {{.ImageName}}:$GITHUB_SHA /bin/bash -c 'make unit_test' - name: Print Volume Used - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' if: ${{"{{ always() }}"}} run: | docker inspect -f '{{"{{ (index .Mounts 0).Name }}"}}' {{.ImageName}}_$GITHUB_SHA - name: Cleanup Docker Volume - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | docker rm -v {{.ImageName}}_$GITHUB_SHA - name: Cleanup Docker Container - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' if: ${{"{{ always() }}"}} run: | docker rm -f {{.ImageName}}_$GITHUB_SHA - name: Cleanup Docker Image - if: steps.changes.outputs.unit_tests == 'true' + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | docker image rm {{.ImageName}}:$GITHUB_SHA