Skip to content

Commit

Permalink
GitHub actions - add test run for edge-testnet & version check
Browse files Browse the repository at this point in the history
Just run the edge-testnet, it should pass nicely (as a test).

Ensure we keep the versions in sync by checking them with a
script.
  • Loading branch information
JanneKiiskila committed Oct 5, 2023
1 parent 67c0d1d commit 1d52187
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,16 @@ jobs:
#- run: git clone https://github.com/PelionIoT/scripts-internal.git
- run: echo "." >scripts-internal/.nopyshcheck
- run: .github/workflows/pysh-checker.sh ${{ github.event.repository.default_branch }} ${{ github.ref_name }}

run-edge-testnet:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Run edge-testnet
run: fw-tools/edge-testnet

versions-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: ./check_versions.sh
39 changes: 39 additions & 0 deletions check_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
#
# Copyright (c) 2023, Izuma Networks
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

edgeinfover=$(head -n 32 "edge-info/edge-info" | tail -n 1)
# Use grep with a regular expression to extract the version
if [[ $edgeinfover =~ version=\"([^\"]+)\" ]]; then
extracted_ver="${BASH_REMATCH[1]}"
else
echo "Version not found from line 32 in edge-info/edge-info -file ($edgeinfover)."
exit 1
fi
devidver=$(head -n 1 "identity-tools/developer_identity/VERSION")
chgver=$(head -n 1 "CHANGELOG.md" | awk '{ for (i=1; i<=NF; i++) if ($i ~ /^[0-9]+\.[0-9]+\.[0-9]+$/) { print $i; exit } }')
echo "ChangeLog version: $chgver"
echo "edge-info version: $extracted_ver"
echo "Identity tool version: $devidver"
if [ "$extracted_ver" != "$devidver" ] || \
[ "$extracted_ver" != "$chgver" ]; then
echo "Versions do not match! @extracted_ver vs. $devidver vs. $chgver"
echo "Fix required."
exit 1
else
echo "Versions match."
fi

0 comments on commit 1d52187

Please sign in to comment.