Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change CI Snapshot branches name #205

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -56,7 +56,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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -68,13 +68,13 @@ jobs:

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

- name: Checkout powsybl-metrix
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: powsybl/powsybl-metrix
ref: ${{ env.INTEGRATION_BRANCH }}
ref: ${{ env.SNAPSHOT_BRANCH }}
path: powsybl-metrix
submodules: true

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

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

# Slack notification on failure
notify_slack:
Expand Down