Jaypore CI

> Jaypore CI: Minimal, Offline, Local CI system.
Log | Files | Refs | README | LICENSE

run.sh (1295B)


      1 #!/bin/bash
      2 set -euo pipefail
      3 
      4 # Jaypore CI run script
      5 # ---------------------
      6 # This script is executed by Jaypore CI.
      7 #
      8 # Available environment variables:
      9 #   JCI_COMMIT      - The git commit being tested
     10 #   JCI_REPO_ROOT   - Absolute path to the repository root
     11 #   JCI_OUTPUT_DIR  - Directory for CI artifacts (cwd at start)
     12 #
     13 # Any files written to JCI_OUTPUT_DIR become CI artifacts.
     14 
     15 echo "=== Jaypore CI: Pylint + Pytest + Coverage ==="
     16 echo "Commit : $JCI_COMMIT"
     17 echo "Repo   : $JCI_REPO_ROOT"
     18 echo "Output : $JCI_OUTPUT_DIR"
     19 echo
     20 
     21 cd "$JCI_REPO_ROOT"
     22 
     23 # ---- 1. Pylint ----
     24 echo "--- Running Pylint on core/ ---"
     25 DJANGO_SETTINGS_MODULE=mysite.settings \
     26 pylint core/ \
     27     --output-format=text \
     28     --disable=C0114,C0115,C0116 \
     29     | tee "$JCI_OUTPUT_DIR/pylint-report.txt" \
     30     || true   # don't fail the build on lint warnings
     31 echo
     32 
     33 # ---- 2. Pytest + Coverage ----
     34 echo "--- Running Pytest with Coverage ---"
     35 pytest \
     36     --cov=core \
     37     --cov-report=html:"$JCI_OUTPUT_DIR/htmlcov" \
     38     --cov-report=term \
     39     | tee "$JCI_OUTPUT_DIR/pytest-results.txt"
     40 echo
     41 
     42 # ---- 3. Summary ----
     43 echo "=== Summary ==="
     44 echo "Pylint report : pylint-report.txt"
     45 echo "Pytest output : pytest-results.txt"
     46 echo "Coverage HTML : htmlcov/index.html"
     47 echo "All artifacts are in $JCI_OUTPUT_DIR"