Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/scripts/check_integration_branch.sh

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/scripts/check_snapshot_branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

repo=$1
core_version=$2

# Add "-SNAPSHOT" to powsybl-core version if not already there
core_snapshot_version=$(echo "$core_version" | grep -q SNAPSHOT && echo "$core_version" || echo "$core_version-SNAPSHOT")

# Find if a CI snapshot branch exists
SNAPSHOT_BRANCH=$(git ls-remote --heads "$repo" | grep -E "refs/heads/ci/core-$core_snapshot_version" | sed 's/.*refs\/heads\///')
if [ -n "$SNAPSHOT_BRANCH" ]; then
echo "SNAPSHOT VERSION EXIST: $SNAPSHOT_BRANCH"
echo "SNAPSHOT_BRANCH=$SNAPSHOT_BRANCH" >> "$GITHUB_ENV"
else
echo "No SNAPSHOT branch found"
echo "SNAPSHOT_BRANCH=main" >> "$GITHUB_ENV"
fi
8 changes: 4 additions & 4 deletions .github/workflows/snapshot-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
working-directory: ./powsybl-core

# Checkout script
# The script check_integration_branch.sh is located in the workflow folder of the repository
# The script check_snapshot_branch.sh is located in the workflow folder of the repository
# It is necessary for checking out the integration branch if it exists
- name: Checkout script
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
Expand All @@ -62,13 +62,13 @@ jobs:

# Build powsybl-afs
- name: Checking for powsybl-afs snapshot branch
run: ${{ env.SCRIPTS_PATH }}/check_integration_branch.sh "https://github.com/powsybl/powsybl-afs.git" ${{ env.CORE_VERSION }}
run: ${{ env.SCRIPTS_PATH }}/check_snapshot_branch.sh "https://github.com/powsybl/powsybl-afs.git" ${{ env.CORE_VERSION }}

- name: Checkout powsybl-afs
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
repository: powsybl/powsybl-afs
ref: ${{ env.INTEGRATION_BRANCH }}
ref: ${{ env.SNAPSHOT_BRANCH }}
path: powsybl-afs
submodules: true

Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:

outputs:
core-version: ${{ env.CORE_VERSION }}
afs-branch: ${{ env.INTEGRATION_BRANCH }}
afs-branch: ${{ env.SNAPSHOT_BRANCH }}

# Slack notification
notify_slack:
Expand Down