51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: set -o pipefail # r19: sin esto, | tail se come los exit codes y un test roto da verde
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup
|
|
run: |
|
|
python3 -m pip install --user ruff pytest --quiet 2>/dev/null || true
|
|
|
|
- name: Lint (ruff, advisory)
|
|
run: |
|
|
if [ -d cayceops ]; then
|
|
ruff check cayceops/ --exit-zero || true
|
|
else
|
|
echo "no python package — OK"
|
|
fi
|
|
|
|
- name: Tests
|
|
run: |
|
|
if [ -d cayceops/tests ]; then
|
|
python3 -m pytest cayceops/tests/ -v --tb=short 2>&1 | tail -5
|
|
else
|
|
echo "no tests dir — OK"
|
|
fi
|
|
|
|
- name: Guard tests
|
|
run: |
|
|
if [ -f runtime/guard.test.mjs ]; then
|
|
cd runtime && node --test guard.test.mjs 2>&1 | tail -3 && cd ..
|
|
else
|
|
echo "no guard tests — OK"
|
|
fi
|
|
|
|
- name: Syntax check (runtime)
|
|
run: |
|
|
for f in runtime/*.mjs; do
|
|
[ -f "$f" ] && node --check "$f" || true
|
|
done
|
|
echo "syntax check OK"
|