Skip to content

Commit

Permalink
Add workflow to check the hardcoded fallback version in pyproject.tom…
Browse files Browse the repository at this point in the history
…l against the version used in CI/run_reframe.sh and check against git tags listed
  • Loading branch information
Caspar van Leeuwen committed Oct 2, 2024
1 parent 15e92d1 commit 5bea644
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/check_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: Test fallback_version and version in run_reframe.sh against tags
on: [push, pull_request, workflow_dispatch]
permissions: read-all
jobs:
test_fallback_version_against_tags:
# ubuntu <= 20.04 is required for python 3.6
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
fetch-depth: 0

- name: Check fallback version and version used in run_reframe.sh
run: |
# Get fallback version
fallback_version=$(grep -oP 'fallback_version\s*=\s*"\K[^"]+' "test-suite-$GITHUB_SHA/pyproject.toml")
# Prepend fallback version with 'v', as that is also the case for the other two version strings
fallback_version="v$fallback_version"
# Get version from run_reframe.sh
run_reframe_testsuite_version=$(grep -oP 'EESSI_TESTSUITE_BRANCH\s*=\s*[^v]*\K[^"\x27]*' "test-suite-$GITHUB_SHA/CI/run_reframe.sh")
# Grab the tag for the highest version, by sorting by (semantic) version, and then filtering on patterns
# that match a pattern like v0.1.2. Finally, we grab the last to get the highest version
most_recent_version=$(git tag --sort=version:refname | grep -P "v[0-9]+\.[0-9]+\.[0-9]+" | tail -n 1)
echo "Testing if fallback version and EESSI_TESTSUITE_BRANCH version in CI/run_reframe.sh are the same"
if [[ "$fallback_version" != "$run_reframe_testsuite_version" ]]; then
echo "Version $fallback_version not equal to $run_reframe_testsuite_version"
exit 1
else
echo "... yes!"
fi
echo "Testing if fallback version and most recent version tag are the same"
if [[ "$fallback_version" != "$most_recent_version" ]]; then
echo "Version $fallback_version not equal to $most_recent_version"
exit 1
else
echo "... yes!"
fi

0 comments on commit 5bea644

Please sign in to comment.