CI: Add new assessments to verify workflow, improve Git tag check

This commit is contained in:
Juno Takano 2026-06-04 16:49:50 -03:00
commit 31dd0a2bbf
4 changed files with 30 additions and 22 deletions

View file

@ -39,9 +39,12 @@ jobs:
useradd -m ci && chown -R ci:ci .
git config --global --add safe.directory "$PWD"
- name: Build
run: just ci build
- name: Text matching checks
run: just ci todos-assess version-assess spell
- name: Schema lint
run: just ci schema-lint
- name: Deny
run: just ci deny
- name: Format
run: just ci format-assess
- name: Lint

View file

@ -51,7 +51,7 @@ alias wc := run-watch-containerized
[private]
assess-quick:
{{ just_cmd }} lint check test-cover-quick spell
{{ just_cmd }} lint check test-cover-quick spell schema-lint
[private]
assess-run-quick:
@ -219,8 +219,8 @@ mutate-single *cargo_test_args:
# Tag HEAD with version from Cargo.toml
[script, group: 'assess']
tag commit="HEAD": update
if [ "{{ last_tag }}" = "{{ manifest_version }}" ]; then
echo "Last tag {{ last_tag }} and manifest ({{ manifest_version }}) already match"
if [ "{{ last_local_tag }}" = "{{ manifest_version }}" ]; then
echo "Last tag {{ last_local_tag }} and manifest ({{ manifest_version }}) already match"
exit
elif [ "{{ manifest_version }}" != "{{ lockfile_version }}" ]; then
echo "Manifest and lockfile versions don't match: update failed?"
@ -231,15 +231,15 @@ tag commit="HEAD": update
{{ just_cmd }} version-assess
# Verify and push
[group: 'develop']
push: verify
[group: 'develop', env("JUST", "1")]
push: verify && (version-assess "true")
git push
git push --tags
alias p := push
# Push without verifying
[group: 'develop']
[group: 'develop', env("JUST", "1")]
push-unsafe:
git push --no-verify
git push --tags --no-verify
@ -355,16 +355,21 @@ alias v := verify
# Check tag-manifest consistency
[script, group: 'assess']
version-assess: update
if
[ "{{ last_tag }}" != "{{ lockfile_version }}" ] \
|| [ "{{ last_tag }}" != "{{ lockfile_version }}" ]
then
printf 'Last tag: %s\nManifest: %s\nLockfile: %s\n' \
"{{ last_tag }}" \
"{{ manifest_version }}" \
"{{ lockfile_version }}"
exit 1
[arg("remote", long="remote", short="r", value="true")]
version-assess remote="false": update
last_remote_tag=$(
git ls-remote --tags --sort=-creatordate origin |
head -n 1 | tr -d v | cut -d / -f 3
)
printf 'Local: %s\nRemote: %s\nManifest: %s\nLockfile: %s\n' \
"{{ last_local_tag }}" \
"$last_remote_tag" \
"{{ manifest_version }}" \
"{{ lockfile_version }}"
test "{{ last_local_tag }}" = "{{ lockfile_version }}"
test "{{ last_local_tag }}" = "{{ manifest_version }}"
if {{ if remote == "true" { "true" } else { "false" } }}; then
test "{{ last_local_tag }}" = "$last_remote_tag"
fi
alias va := version-assess
@ -481,7 +486,7 @@ just_cmd_no_ts := 'just --explain --command-color green'
watch_cmd := "watchexec -qc -r -e rs,toml,html,css --color always -- "
cover_cmd := 'cargo llvm-cov --color always --ignore-filename-regex "main\.rs|log\.rs"'
last_tag := `git tag --sort=-creatordate | head -1 | tr -d v`
last_local_tag := `git tag --sort=-creatordate | head -1 | tr -d v`
manifest_version := `grep "^version" Cargo.toml | cut -d \" -f 2`
lockfile_version := ```
grep -A 1 'name = "en"' Cargo.lock \

2
Cargo.lock generated
View file

@ -238,7 +238,7 @@ dependencies = [
[[package]]
name = "en"
version = "0.4.1-alpha"
version = "0.4.0-alpha"
dependencies = [
"axum",
"serde",

View file

@ -1,6 +1,6 @@
[package]
name = "en"
version = "0.4.1-alpha"
version = "0.4.0-alpha"
description = "A non-linear writing instrument."
license = "AGPL-3.0-only"