ci.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. if which nproc > /dev/null; then
  3. MAKEOPTS="-rRj$(nproc)"
  4. else
  5. MAKEOPTS="-rRj$(sysctl -n hw.ncpu)"
  6. fi
  7. ########################################################################################
  8. # code formatting
  9. function ci_code_formatting_setup {
  10. sudo apt-get install uncrustify
  11. pip3 install black
  12. uncrustify --version
  13. black --version
  14. }
  15. function ci_code_formatting_run {
  16. tools/codeformat.py -v
  17. }
  18. ########################################################################################
  19. # code spelling
  20. function ci_code_spell_setup {
  21. pip install codespell
  22. }
  23. function ci_code_spell_run {
  24. codespell firmware/ src/
  25. }
  26. ########################################################################################
  27. # tests
  28. function ci_tests_setup {
  29. sudo dpkg --add-architecture i386
  30. sudo apt-get update
  31. sudo apt-get install gcc-multilib
  32. }
  33. function ci_tests_build {
  34. make $MAKEOPTS -C tests/sdio
  35. make $MAKEOPTS -C tests/debug_print
  36. }
  37. function ci_tests_run {
  38. make $MAKEOPTS -C tests/sdio test
  39. make $MAKEOPTS -C tests/debug_print test
  40. }