Skip to content

Commit b6c2f10

Browse files
authored
Merge pull request #194 from yingmanwumen/ci_check_ulist_version
check the ulist versions via tests/run.sh
2 parents 81de9f9 + 1b70739 commit b6c2f10

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/check_version.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# check the ulist versions first
2+
check_version() {
3+
local pp="../ulist/python/ulist/__init__.py"
4+
local pd="../docs/conf.py"
5+
local pc="../ulist/Cargo.toml"
6+
local vp=$(grep "__version" $pp | awk '{print $NF}' | sed 's/"//g')
7+
local vd=$(grep "release = " $pd | awk '{print $NF}' | sed "s/'//g")
8+
local vc=$(grep "version = " $pc | head -1 | awk '{print $NF}' | sed 's/"//g')
9+
if [ $vp != $vd -o $vp != $vc ]; then
10+
echo "Ulist versions don't match!"
11+
echo "$pp: $vp"
12+
echo "$pd: $vd"
13+
echo "$pc: $vc"
14+
echo "\n"
15+
return 1
16+
fi
17+
return 0
18+
}
19+

tests/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
. ./check_version.sh
2+
13
EXIT_STATUS=0
24

5+
check_version || EXIT_STATUS=$?
6+
37
echo "Running clippy..."
48
cargo clippy --manifest-path ../ulist/Cargo.toml -- -D warnings|| EXIT_STATUS=$?
59
echo "\n"

0 commit comments

Comments
 (0)