WIP: test de la CI
/ synchro (push) Successful in 1s Details
/ tests (push) Failing after 0s Details

This commit is contained in:
Adrien Bourmault 2023-10-20 11:02:59 +02:00
parent 61f02dd275
commit 4f5905c1ef
Signed by: neox
GPG Key ID: 2974E1D5F25DFCC8
1 changed files with 33 additions and 4 deletions

View File

@ -10,9 +10,38 @@ jobs:
- name: Retrieve files - name: Retrieve files
shell: bash shell: bash
run: | run: |
echo Sync files with server
echo "We are in $PWD"
git clone ${{ gitea.server_url }}/${{ gitea.repository }} www git clone ${{ gitea.server_url }}/${{ gitea.repository }} www
cd www - name: Synchronize files
echo "We have : $(ls -lta)" 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)
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
- run: echo "Job ended with status '${{ job.status }}'." - run: echo "Job ended with status '${{ job.status }}'."