From 4c2ed1676f101812587f949b4eccfe2707b6bc57 Mon Sep 17 00:00:00 2001 From: Euripedes Rocha Date: Fri, 2 Jun 2023 10:55:55 +0200 Subject: [PATCH] CI: Add check for Gitlab/Github remotes in sync To avoid merging on Gitlab with Github remote out of sync while we are moving to Github development. --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed90913..43e5053 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - build + - test - deploy @@ -80,6 +81,15 @@ build_and_test_qemu: - export MQTT_PUBLISH_MSG_len_3=20 MQTT_PUBLISH_MSG_repeat_3=20 - python Runner.py $TEST_PATH -c $MQTT_PATH/ci/publish_connect_mqtt_qemu.yml -e $TEST_PATH/env.yml +check_remotes_sync: + stage: test + when: on_success + script: + - *add_gh_key_remote + - git fetch --depth=1 origin master + - git fetch --depth=1 github master + - test "$(git rev-parse origin/master)" == "$(git rev-parse github/master)" + push_master_to_github: stage: deploy image: ${CI_DOCKER_REGISTRY}/esp32-ci-env