|
31 | 31 | export PATH="$HOME/.local/bin:$PATH" |
32 | 32 | clang-format --version |
33 | 33 | clang-format --dry-run --Werror $files |
| 34 | + # A release states its version in each package's manifest and in what each part |
| 35 | + # writes about itself (`mtest version`, a catalog, a session, a program's hello). |
| 36 | + # 0.6.1 was released with the sources still writing 0.6.0, and a CI that pinned |
| 37 | + # 0.6.1 refused it. |
| 38 | + - name: One version in the manifests and in what the sources write |
| 39 | + run: | |
| 40 | + set -euo pipefail |
| 41 | + version=$(sed -n 's/^version *= *"\(.*\)"/\1/p' engine/mcpp.toml | head -1) |
| 42 | + bad=0 |
| 43 | + for m in $(git ls-files '*/mcpp.toml'); do |
| 44 | + v=$(sed -n '/^\[package\]/,/^\[/s/^version *= *"\(.*\)"/\1/p' "$m" | head -1) |
| 45 | + [ -z "$v" ] || [ "$v" = "$version" ] || { echo "::error file=$m::version $v, the engine is $version"; bad=1; } |
| 46 | + done |
| 47 | + stated=$(git grep -nE '"version", "[0-9]+\.[0-9]+\.[0-9]+"|\.version\("[0-9.]+"\)|"mtest [0-9]+\.[0-9]+\.[0-9]+"' -- '*.cpp' '*.cppm') |
| 48 | + [ -n "$stated" ] || { echo "::error::no source states the version; this check reads nothing"; exit 1; } |
| 49 | + while IFS= read -r line; do |
| 50 | + case "$line" in *"\"$version\""*|*"mtest $version\""*) ;; *) echo "::error::$line: not $version"; bad=1 ;; esac |
| 51 | + done <<< "$stated" |
| 52 | + exit $bad |
34 | 53 | - name: No local path in what is tracked |
35 | 54 | run: | |
36 | 55 | set -euo pipefail |
@@ -142,7 +161,8 @@ jobs: |
142 | 161 | mkdir -p dist unpacked |
143 | 162 | cp "target/dist/$package.tar.gz" "target/dist/mtest-$version.okb" dist/ |
144 | 163 | tar -xzf "dist/$package.tar.gz" -C unpacked |
145 | | - "unpacked/$package/bin/mtest" version |
| 164 | + said=$("unpacked/$package/bin/mtest" version) |
| 165 | + [ "$said" = "mtest $version" ] || { echo "::error::the packaged engine says '$said', the manifest $version"; exit 1; } |
146 | 166 | python3 - "unpacked/$package/mcpp-package.json" <<'PY' |
147 | 167 | import json, sys |
148 | 168 | d = json.load(open(sys.argv[1])) |
|
0 commit comments