www/.forgejo/workflows/ci.yaml

48 lines
1.5 KiB
YAML

on:
push:
branches:
- 'master'
jobs:
synchro:
runs-on: linux_amd64
steps:
- name: Retrieve files
shell: bash
run: |
git clone ${{ gitea.server_url }}/${{ gitea.repository }} www
- name: Synchronize files
shell: bash
run: |
rsync -avzlh --delete --filter='P sidebar/*' * /home/webmaster/site-chalec.org/articles/
echo $(git diff-tree --no-commit-id --name-only -r master | grep stl || find . -name "*.stl" -printf "%P\n") > /home/webmaster/site-chalec.org/.modified
- run: echo "Job ended with status '${{ job.status }}'."
tests:
runs-on: linux_amd64
steps:
- name: Syntax & validity checks
shell: bash
run: |
cd /home/webmaster/site-chalec.org
files=$(cat .modified)
if [ -z "$files" ]; then
files=$(find . -name "*.stl" -printf %P)
fi
errors=0
for file in $files
do
echo "### Test de $file"
stl log clean
stl check -F $file | grep -e "Err" -e "erreur de" -e "Aucun fichier" && errors=$((errors+1)) # error if err is read in standard output
done
[ $errors -gt 0 ] && false
for file in $files
do
echo "Test supplémentaire de $file"
stl log clean
stl check -F $file &> /dev/null
stl check -F $file &> /dev/null
done
[ $errors -gt 0 ] && false