Add CI check for chart of accounts

This commit is contained in:
Cédric Krier
2024-10-30 19:02:22 +01:00
parent a79563f514
commit 015f454609
2 changed files with 77 additions and 0 deletions
+20
View File
@@ -194,6 +194,26 @@ check-template-modules:
script:
- .gitlab-scripts/check-template-modules.sh
check-account-chart:
extends: .check
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine
before_script:
- apk add --no-cache libxslt
script:
- .gitlab-scripts/check-account-chart.sh
rules:
- if: $CI_COMMIT_TAG == null
changes:
- modules/*/localize.xsl
- modules/account/account_chart*.xml
- modules/account_be/account_be*.xml
- modules/account_be/tax_be*.xml
- modules/account_es/account*.xml
- modules/account_es/tax*.xml
- modules/account_syscohada/account_syscohada*.xml
when: on_success
- when: never
.test:
stage: test
rules:
+57
View File
@@ -0,0 +1,57 @@
#!/bin/sh
set -eu
OUTPUT=`mktemp -d`
module="modules/account"
mkdir -p "${OUTPUT}/${module}"
for lang in en
do
printf "Check ${module} ${lang} ..."
file="${module}/account_chart_${lang}.xml"
xsltproc --stringparam lang "${lang}" "${module}/localize.xsl" "${module}/account_chart.xml" > "${OUTPUT}/${file}"
cmp "${file}" "${OUTPUT}/${file}"
printf "OK\n"
done
module="modules/account_be"
mkdir -p "${OUTPUT}/${module}"
for lang in fr nl
do
printf "Check ${module} ${lang} ..."
for template in account tax
do
file="${module}/${template}_be_${lang}.xml"
xsltproc --stringparam lang "${lang}" "${module}/localize.xsl" "${module}/${template}_be.xml" > "${OUTPUT}/${file}"
cmp "${file}" "${OUTPUT}/${file}"
done
printf "OK\n"
done
module="modules/account_es"
mkdir -p "${OUTPUT}/${module}"
for chart in normal pyme
do
printf "Check ${module} ${chart} ..."
for template in account tax
do
file="${module}/${template}_${chart}.xml"
xsltproc --stringparam chart "${chart}" "${module}/create_chart.xsl" "${module}/${template}.xml" > "${OUTPUT}/${file}"
cmp "${file}" "${OUTPUT}/${file}"
done
printf "OK\n"
done
module="modules/account_syscohada"
mkdir -p "${OUTPUT}/${module}"
for chart in 2001 2016
do
for lang in fr
do
printf "Check ${module} ${chart} ${lang} ..."
file="${module}/account_syscohada_${chart}_${lang}.xml"
xsltproc --stringparam chart "${chart}" --stringparam lang "${lang}" "${module}/localize.xsl" "${module}/account_syscohada.xml" | sed -e "s/\$country/SYSCOHADA/" > "${OUTPUT}/${file}"
cmp "${file}" "${OUTPUT}/${file}"
printf "OK\n"
done
done