Skip to content

Commit

Permalink
Added script for version check in CI checks
Browse files Browse the repository at this point in the history
Added conditional execution for check-version script

Extracting check-version into release checks job
  • Loading branch information
dheerajd5 committed Sep 21, 2023
1 parent df2fa80 commit 0b2b5b4
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive


- name: Build and test
run: |
Expand Down Expand Up @@ -152,6 +153,7 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
fetch-tags: true

- name: Build and test
run: |
Expand Down Expand Up @@ -315,3 +317,31 @@ jobs:
if: failure()
run: |
scripts/ci_checks/failure.sh
release-checks:
runs-on: ubuntu-latest

if: ${{ startsWith(github.ref, 'refs/tags/v') }}
strategy:
fail-fast: false
matrix:
include:
- script: linux-checks/check-version

name: ${{ matrix.script }}
steps:

- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-tags: true

- name: Build and test
run: |
scripts/ci_checks/${{ matrix.script }}.sh
- name: Handle failure
if: failure()
run: |
scripts/ci_checks/failure.sh
22 changes: 22 additions & 0 deletions scripts/ci_checks/linux-checks/check-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -euo pipefail


tagname="$(git tag -l | tail -n1)"

header_tagname="v$(python3 scripts/scons_helpers/parse-version.py)"

if [[ "$tagname" != "$header_tagname" ]]; then
echo >&2
echo >&2"version check FAILED"
echo >&2"the git tag name and version declared in version.h is not the same"
echo >&2"${tagname} git version tag"
echo >&2"${header_tagname} header version tag"
echo >&2
exit 1
fi

echo "version check SUCCEEDED"
echo

0 comments on commit 0b2b5b4

Please sign in to comment.