Skip to content

Commit eaaae6a

Browse files
rolnicoNaledi EL CHEIKH
authored andcommitted
Switch snapshot ci to new app and rework notification design (#938)
* rework CI snapshot * add print * fix jobs name * format results * change references from integration to snapshot Signed-off-by: Nicolas Rol <[email protected]> Signed-off-by: Naledi EL CHEIKH <[email protected]>
1 parent 8373d33 commit eaaae6a

File tree

3 files changed

+375
-110
lines changed

3 files changed

+375
-110
lines changed

.github/workflows/scripts/build_module.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
MODULE_NAME=$1
44
COMMAND=$2
5+
CURRENT_OS=$3
6+
CURRENT_PYTHON=$4
57

68
echo "Building $MODULE_NAME..."
79
$COMMAND
810
BUILD_EXIT=$?
9-
1011
if [ $BUILD_EXIT -ne 0 ]; then
11-
echo "$MODULE_NAME build FAILED" >> $BUILD_STATUS
12+
printf 'BUILD_RESULT=%s;%s;%s;failure\n' "$CURRENT_OS" "$CURRENT_PYTHON" "$MODULE_NAME" >> "$GITHUB_OUTPUT"
1213
else
13-
echo "$MODULE_NAME build SUCCESS" >> $BUILD_STATUS
14+
printf 'BUILD_RESULT=%s;%s;%s;success\n' "$CURRENT_OS" "$CURRENT_PYTHON" "$MODULE_NAME" >> "$GITHUB_OUTPUT"
1415
fi
15-
1616
exit $BUILD_EXIT

.github/workflows/scripts/check_snapshot_branch.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
repo=$1
44
core_version=$2
55

6-
SNAPSHOT_BRANCH=$(git ls-remote --heads "$repo" | grep -E "refs/heads/$(echo $core_version | grep -q SNAPSHOT && echo "$core_version" || echo "$core_version-SNAPSHOT")" | sed 's/.*refs\/heads\///')
6+
# Add "-SNAPSHOT" to powsybl-core version if not already there
7+
core_snapshot_version=$(echo "$core_version" | grep -q SNAPSHOT && echo "$core_version" || echo "$core_version-SNAPSHOT")
8+
9+
# Find if an CI snapshot branch exists
10+
SNAPSHOT_BRANCH=$(git ls-remote --heads "$repo" | grep -E "refs/heads/ci/core-$core_snapshot_version" | sed 's/.*refs\/heads\///')
711
if [ -n "$SNAPSHOT_BRANCH" ]; then
812
echo "SNAPSHOT VERSION EXIST: $SNAPSHOT_BRANCH"
9-
echo "SNAPSHOT_BRANCH=$SNAPSHOT_BRANCH" >> $GITHUB_ENV
13+
echo "SNAPSHOT_BRANCH=$SNAPSHOT_BRANCH" >> "$GITHUB_ENV"
1014
else
1115
echo "No SNAPSHOT branch found"
12-
echo "SNAPSHOT_BRANCH=main" >> $GITHUB_ENV
13-
fi
14-
15-
16+
echo "SNAPSHOT_BRANCH=main" >> "$GITHUB_ENV"
17+
fi

0 commit comments

Comments
 (0)