2023-10-20 10:08:58 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
|
2023-10-20 09:29:31 +02:00
|
|
|
jobs:
|
2023-10-20 09:36:00 +02:00
|
|
|
synchro:
|
2023-10-20 09:29:31 +02:00
|
|
|
runs-on: linux_amd64
|
|
|
|
steps:
|
2023-10-20 10:49:00 +02:00
|
|
|
- name: Retrieve files
|
2023-10-20 10:08:58 +02:00
|
|
|
shell: bash
|
2023-10-20 09:49:43 +02:00
|
|
|
run: |
|
2023-10-20 10:51:32 +02:00
|
|
|
git clone ${{ gitea.server_url }}/${{ gitea.repository }} www
|
2023-10-20 11:02:59 +02:00
|
|
|
- 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)
|
2023-10-20 11:06:47 +02:00
|
|
|
fi
|
2023-10-20 11:02:59 +02:00
|
|
|
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
|